"File 'cd0' exists but cannot be stated" fix for QNX 6.x



Hello!

QNX 6.x CDROM driver always keeps file '/fs/cd0', which exists, but
cannot be stat()'ed if there's no disk in drive.
a.e. you may see something like that (without mc running):

# ls -la /fs
ls: No such device or address (/fs/cd0)
total 96
drwxrwxrwx 49 root      root          32768 Oct 08 22:37 hd0-dos

QNX 6.x automatically mounts all available filesystems under /fs, so
it is used very often and "cannot be stated" messages becomes very
annoying.

Here's a small hack against it:

--- src/dir.c.orig  Thu Dec 26 02:21:43 2002
+++ src/dir.c   Sat Jan  4 20:58:54 2003
@@ -382,6 +382,10 @@
     if (!show_backups && dp->d_name [NLENGTH (dp)-1] == '~')
    return 0;
     if (mc_lstat (dp->d_name, buf1) == -1) {
+#ifdef __QNXNTO__
+   if (dp->d_name [0] == 'c' && dp->d_name [1] == 'd')
+       return 0;
+#endif     
    message(1, MSG_ERROR, _("File '%s' exists but cannot be stat-ed: %s"), dp->d_name, strerror(errno));
         return 0;
     }

WBR,
Dmitry Alexeyev




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]