Add test for force where it counts
authorhpa <hpa>
Fri, 19 Mar 1999 21:04:32 +0000 (21:04 +0000)
committerhpa <hpa>
Fri, 19 Mar 1999 21:04:32 +0000 (21:04 +0000)
syslinux.c

index 3551a04..b405494 100644 (file)
@@ -100,7 +100,7 @@ static u_int32_t get_32(unsigned char *p)
 
 void usage(void)
 {
-  fprintf(stderr, "Usage: %s [-s] device\n", program);
+  fprintf(stderr, "Usage: %s [-sf] device\n", program);
   exit(1);
 }
 
@@ -161,7 +161,7 @@ int main(int argc, char *argv[])
     exit(1);
   }
 
-  if ( !S_ISBLK(st.st_mode) && !S_ISREG(st.st_mode) ) {
+  if ( !force && !S_ISBLK(st.st_mode) && !S_ISREG(st.st_mode) ) {
     fprintf(stderr, "%s: not a block device or regular file (use -f to override)\n", device);
     exit(1);
   }