From 27808a32ee6c872657c6a08a62ef3efc02c19e7c Mon Sep 17 00:00:00 2001 From: zab Date: Mon, 17 Nov 2003 18:46:30 +0000 Subject: [PATCH] - give the user an error message when the dump file can't be opened --- lnet/utils/l_ioctl.c | 5 +++++ lustre/portals/utils/l_ioctl.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lnet/utils/l_ioctl.c b/lnet/utils/l_ioctl.c index 16e398d..58a408a 100644 --- a/lnet/utils/l_ioctl.c +++ b/lnet/utils/l_ioctl.c @@ -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 diff --git a/lustre/portals/utils/l_ioctl.c b/lustre/portals/utils/l_ioctl.c index 16e398d..58a408a 100644 --- a/lustre/portals/utils/l_ioctl.c +++ b/lustre/portals/utils/l_ioctl.c @@ -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 -- 1.8.3.1