aboutsummaryrefslogtreecommitdiffstats
path: root/dos/syslinux.c
diff options
context:
space:
mode:
authorShao Miller <shao.miller@yrdsb.edu.on.ca>2010-07-03 19:06:10 -0400
committerShao Miller <shao.miller@yrdsb.edu.on.ca>2010-07-03 19:06:10 -0400
commit1fb6b70cdacaf3ca3c069a6d96434eed3b6bc22f (patch)
tree7dcd6a881e9df4ad6a43ebe7b864a4eade64e869 /dos/syslinux.c
parent07aafae7c67b32e432c26ff83279ec83e61592e4 (diff)
downloadsyslinux-devel-1fb6b70cdacaf3ca3c069a6d96434eed3b6bc22f.tar.gz
syslinux-devel-1fb6b70cdacaf3ca3c069a6d96434eed3b6bc22f.tar.xz
syslinux-devel-1fb6b70cdacaf3ca3c069a6d96434eed3b6bc22f.zip
dos: Work-in-progress
Diffstat (limited to 'dos/syslinux.c')
-rwxr-xr-x[-rw-r--r--]dos/syslinux.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/dos/syslinux.c b/dos/syslinux.c
index 9574553d..891980e8 100644..100755
--- a/dos/syslinux.c
+++ b/dos/syslinux.c
@@ -18,15 +18,18 @@
*/
#include <errno.h>
+#include <getopt.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <stdarg.h>
+//#include <stdarg.h>
#include "mystuff.h"
#include "syslinux.h"
#include "libfat.h"
#include "setadv.h"
+#include "sysexits.h"
+#include "syslxopt.h"
const char *program = "syslinux"; /* Name of program */
uint16_t dos_version;
@@ -44,12 +47,6 @@ void pause(void)
# define pause() ((void)0)
#endif
-void __attribute__ ((noreturn)) usage(void)
-{
- puts("Usage: syslinux [-sfmar][-d directory] <drive>: [bootsecfile]\n");
- exit(1);
-}
-
void unlock_device(int);
void __attribute__ ((noreturn)) die(const char *msg)
@@ -617,7 +614,7 @@ int main(int argc, char *argv[])
if (**argp == '-') {
opt = *argp + 1;
if (!*opt)
- usage();
+ usage(EX_USAGE, MODE_SYSLINUX_DOSWIN);
while (*opt) {
switch (*opt) {
@@ -641,13 +638,13 @@ int main(int argc, char *argv[])
subdir = *++argp;
break;
default:
- usage();
+ usage(EX_USAGE, MODE_SYSLINUX_DOSWIN);
}
opt++;
}
} else {
if (bootsecfile)
- usage();
+ usage(EX_USAGE, MODE_SYSLINUX_DOSWIN);
else if (device)
bootsecfile = *argp;
else
@@ -656,7 +653,7 @@ int main(int argc, char *argv[])
}
if (!device)
- usage();
+ usage(EX_USAGE, MODE_SYSLINUX_DOSWIN);
/*
* Create an ADV in memory... this should be smarter.
@@ -668,7 +665,7 @@ int main(int argc, char *argv[])
*/
dev_fd = (device[0] & ~0x20) - 0x40;
if (dev_fd < 1 || dev_fd > 26 || device[1] != ':' || device[2])
- usage();
+ usage(EX_USAGE, MODE_SYSLINUX_DOSWIN);
set_lock_device(dev_fd);