home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / linux / 10032 < prev    next >
Encoding:
Text File  |  1992-09-08  |  2.5 KB  |  74 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!spool.mu.edu!uwm.edu!daffy!saavik.cs.wisc.edu!quale
  3. From: quale@saavik.cs.wisc.edu (Douglas E. Quale)
  4. Subject: MOUNT(8) IS STILL A DISASTER !!!
  5. Message-ID: <1992Sep7.003932.8013@daffy.cs.wisc.edu>
  6. Sender: news@daffy.cs.wisc.edu (The News)
  7. Organization: Undergraduate Projects Lab, UW Madison
  8. Date: Mon, 7 Sep 1992 00:39:32 GMT
  9. Lines: 63
  10.  
  11.  
  12. Well, mount(8) is still disaster.  Already I have reports of two problems.
  13.  
  14. 1) It won't compile with the 2.2.2d header files.  This has the advantage
  15. that you'll never see any other bugs, but it does reduce its usefulness
  16. somewhat.  The mount(2) prototype I used in sys/mount.h and in the _syscall5
  17. in mount.c doesn't agree with <unistd.h>.  The easy fix is to comment out
  18. the prototype in <unistd.h>.  The better fix is to correct my prototypes
  19. by adding the const qualifier to the final parameter of mount(2) in both
  20. places.  The patch below takes care of this.
  21.  
  22. 2) The root entry doesn't get added to the mtab when the mtab is missing.
  23. This used to work right, and it was more convenient than using printroot.
  24. The patch below makes it work again.
  25.  
  26.  
  27. --- 1.1    1992/09/06 13:30:53
  28. +++ mount.c    1992/09/06 23:57:19
  29. @@ -15,7 +15,7 @@
  30.  #include <unistd.h>
  31.  
  32.  _syscall5(int, mount, const char *, special, const char *, dir,
  33. -       const char *, type, unsigned long, flags, void *, data);
  34. +       const char *, type, unsigned long, flags, const void *, data);
  35.  #endif
  36.  
  37.  
  38. --- 1.1    1992/09/06 13:30:53
  39. +++ sundries.c    1992/09/06 23:57:20
  40. @@ -153,6 +153,7 @@
  41.        if (addmntent (F_mtab, fstab) == 1)
  42.      die (1, "mount: error writing %s: %s", MOUNTED, strerror (errno));
  43.      }
  44. +  endmntent (F_mtab);
  45.  }
  46.  
  47.  /* Open mtab.  */
  48. @@ -159,8 +160,10 @@
  49.  void
  50.  open_mtab (const char *mode)
  51.  {
  52. -  if ((F_mtab = setmntent (MOUNTED, mode)) == NULL)
  53. +  if (fopen (MOUNTED, "r") == NULL)
  54.      create_mtab ();
  55. +  if ((F_mtab = setmntent (MOUNTED, mode)) == NULL)
  56. +    die (2, "can't open %s: %s", MOUNTED, strerror (errno));
  57.  }
  58.  
  59.  /* Close mtab.  */
  60. --- sys/mount.h~    Sun Sep  6 08:22:57 1992
  61. +++ sys/mount.h    Sun Sep  6 18:57:20 1992
  62. @@ -113,7 +113,7 @@
  63.  #ifdef HAVE_MOUNT5
  64.  /* 0.96c-pl1 and later we have a five argument mount(2).  */
  65.  int mount (const char *__special, const char *__dir,
  66. -       const char *__type, unsigned long __flags, void *__data);
  67. +       const char *__type, unsigned long __flags, const void *__data);
  68.  #else
  69.  /* Before 0.96c-pl1 we had a four argument mount(2).  */
  70.  int mount (const char *__special, const char *__dir,
  71. -- 
  72. Doug Quale
  73. quale@saavik.cs.wisc.edu
  74.