Whamcloud - gitweb
- give the user an error message when the dump file can't be opened
authorzab <zab>
Mon, 17 Nov 2003 18:46:30 +0000 (18:46 +0000)
committerzab <zab>
Mon, 17 Nov 2003 18:46:30 +0000 (18:46 +0000)
lnet/utils/l_ioctl.c
lustre/portals/utils/l_ioctl.c

index 16e398d..58a408a 100644 (file)
@@ -238,6 +238,11 @@ parse_dump(char * dump_file, int (*ioc_func)(int dev_id, int opc, void *))
        
 #ifndef __CYGWIN__
        fd = syscall(SYS_open, dump_file, O_RDONLY);
+        if (fd < 0) {
+                fprintf(stderr, "couldn't open %s: %s\n", dump_file, 
+                        strerror(errno));
+                exit(1);
+        }
 
 #ifndef SYS_fstat64
 # define __SYS_fstat__ SYS_fstat
index 16e398d..58a408a 100644 (file)
@@ -238,6 +238,11 @@ parse_dump(char * dump_file, int (*ioc_func)(int dev_id, int opc, void *))
        
 #ifndef __CYGWIN__
        fd = syscall(SYS_open, dump_file, O_RDONLY);
+        if (fd < 0) {
+                fprintf(stderr, "couldn't open %s: %s\n", dump_file, 
+                        strerror(errno));
+                exit(1);
+        }
 
 #ifndef SYS_fstat64
 # define __SYS_fstat__ SYS_fstat