|
|
| |
fp = fopen("/etc/fstab", "r"); | fp = fopen("/etc/fstab", "r"); |
if (fp == NULL) { | if (fp == NULL) { |
fprintf(stderr, _("%s: unable to open /etc/fstab: %s\n"), programName, strerror(errno)); |
/* |
exit(1); |
* /etc/fstab may be unreadable in some situations due to passwords in the |
|
* file. |
|
*/ |
|
if (v_option) |
|
printf( _("%s: unable to open /etc/fstab: %s\n"), programName, strerror(errno)); |
|
return -1; |
} | } |
| |
while (fgets(line, sizeof(line), fp) != 0) { | while (fgets(line, sizeof(line), fp) != 0) { |
|
|
/* if not currently mounted, see if it is a possible mount point */ | /* if not currently mounted, see if it is a possible mount point */ |
if (!mounted) { | if (!mounted) { |
mountable = MountableDevice(fullName, &mountName, &deviceName); | mountable = MountableDevice(fullName, &mountName, &deviceName); |
if (v_option) { |
/* if return value -1 then fstab could not be read */ |
|
if (v_option && (mountable >= 0)) { |
if (mountable) | if (mountable) |
printf(_("%s: `%s' can be mounted at `%s'\n"), programName, deviceName, mountName); | printf(_("%s: `%s' can be mounted at `%s'\n"), programName, deviceName, mountName); |
else | else |