aboutsummaryrefslogtreecommitdiff
path: root/util-linux/mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/mount.c')
-rw-r--r--util-linux/mount.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 755a3fb13..ae4417cb8 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -127,7 +127,7 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
127 char *lofile = NULL; 127 char *lofile = NULL;
128#endif 128#endif
129 129
130 if (fakeIt == FALSE) 130 if (! fakeIt)
131 { 131 {
132#if defined CONFIG_FEATURE_MOUNT_LOOP 132#if defined CONFIG_FEATURE_MOUNT_LOOP
133 if (use_loop==TRUE) { 133 if (use_loop==TRUE) {
@@ -163,7 +163,7 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
163 if (status == 0 || fakeIt==TRUE) { 163 if (status == 0 || fakeIt==TRUE) {
164 164
165#if defined CONFIG_FEATURE_MTAB_SUPPORT 165#if defined CONFIG_FEATURE_MTAB_SUPPORT
166 if (useMtab == TRUE) { 166 if (useMtab) {
167 erase_mtab(specialfile); // Clean any stale entries 167 erase_mtab(specialfile); // Clean any stale entries
168 write_mtab(specialfile, dir, filesystemtype, flags, mtab_opts); 168 write_mtab(specialfile, dir, filesystemtype, flags, mtab_opts);
169 } 169 }
@@ -210,19 +210,19 @@ parse_mount_options(char *options, int *flags, char *strflags)
210 f++; 210 f++;
211 } 211 }
212#if defined CONFIG_FEATURE_MOUNT_LOOP 212#if defined CONFIG_FEATURE_MOUNT_LOOP
213 if (gotone == FALSE && !strcasecmp("loop", options)) { /* loop device support */ 213 if (! gotone && !strcasecmp("loop", options)) { /* loop device support */
214 use_loop = TRUE; 214 use_loop = TRUE;
215 gotone = TRUE; 215 gotone = TRUE;
216 } 216 }
217#endif 217#endif
218 if (*strflags && strflags != '\0' && gotone == FALSE) { 218 if (*strflags && strflags != '\0' && ! gotone) {
219 char *temp = strflags; 219 char *temp = strflags;
220 220
221 temp += strlen(strflags); 221 temp += strlen(strflags);
222 *temp++ = ','; 222 *temp++ = ',';
223 *temp++ = '\0'; 223 *temp++ = '\0';
224 } 224 }
225 if (gotone == FALSE) 225 if (! gotone)
226 strcat(strflags, options); 226 strcat(strflags, options);
227 if (comma) { 227 if (comma) {
228 *comma = ','; 228 *comma = ',';
@@ -261,7 +261,7 @@ mount_one(char *blockDevice, char *directory, char *filesystemType,
261 status = do_mount(blockDevice, directory, filesystemType, 261 status = do_mount(blockDevice, directory, filesystemType,
262 flags | MS_MGC_VAL, string_flags, 262 flags | MS_MGC_VAL, string_flags,
263 useMtab, fakeIt, mtab_opts, mount_all); 263 useMtab, fakeIt, mtab_opts, mount_all);
264 if (status == TRUE) 264 if (status)
265 break; 265 break;
266 } 266 }
267 } 267 }
@@ -286,7 +286,7 @@ mount_one(char *blockDevice, char *directory, char *filesystemType,
286 status = do_mount(blockDevice, directory, filesystemType, 286 status = do_mount(blockDevice, directory, filesystemType,
287 flags | MS_MGC_VAL, string_flags, 287 flags | MS_MGC_VAL, string_flags,
288 useMtab, fakeIt, mtab_opts, mount_all); 288 useMtab, fakeIt, mtab_opts, mount_all);
289 if (status == TRUE) 289 if (status)
290 break; 290 break;
291 } 291 }
292 } 292 }
@@ -299,8 +299,8 @@ mount_one(char *blockDevice, char *directory, char *filesystemType,
299 fakeIt, mtab_opts, mount_all); 299 fakeIt, mtab_opts, mount_all);
300 } 300 }
301 301
302 if (status == FALSE) { 302 if (! status) {
303 if (whineOnErrors == TRUE) { 303 if (whineOnErrors) {
304 perror_msg("Mounting %s on %s failed", blockDevice, directory); 304 perror_msg("Mounting %s on %s failed", blockDevice, directory);
305 } 305 }
306 return (FALSE); 306 return (FALSE);
@@ -433,7 +433,7 @@ extern int mount_main(int argc, char **argv)
433 if (optind + 1 < argc) 433 if (optind + 1 < argc)
434 directory = simplify_path(argv[optind + 1]); 434 directory = simplify_path(argv[optind + 1]);
435 435
436 if (all == TRUE || optind + 1 == argc) { 436 if (all || optind + 1 == argc) {
437 struct mntent *m = NULL; 437 struct mntent *m = NULL;
438 FILE *f = setmntent("/etc/fstab", "r"); 438 FILE *f = setmntent("/etc/fstab", "r");
439 fstabmount = TRUE; 439 fstabmount = TRUE;
@@ -442,20 +442,20 @@ extern int mount_main(int argc, char **argv)
442 perror_msg_and_die( "\nCannot read /etc/fstab"); 442 perror_msg_and_die( "\nCannot read /etc/fstab");
443 443
444 while ((m = getmntent(f)) != NULL) { 444 while ((m = getmntent(f)) != NULL) {
445 if (all == FALSE && optind + 1 == argc && ( 445 if (! all && optind + 1 == argc && (
446 (strcmp(device, m->mnt_fsname) != 0) && 446 (strcmp(device, m->mnt_fsname) != 0) &&
447 (strcmp(device, m->mnt_dir) != 0) ) ) { 447 (strcmp(device, m->mnt_dir) != 0) ) ) {
448 continue; 448 continue;
449 } 449 }
450 450
451 if (all == TRUE && ( // If we're mounting 'all' 451 if (all && ( // If we're mounting 'all'
452 (strstr(m->mnt_opts, "noauto")) || // and the file system isn't noauto, 452 (strstr(m->mnt_opts, "noauto")) || // and the file system isn't noauto,
453 (strstr(m->mnt_type, "swap")) || // and isn't swap or nfs, then mount it 453 (strstr(m->mnt_type, "swap")) || // and isn't swap or nfs, then mount it
454 (strstr(m->mnt_type, "nfs")) ) ) { 454 (strstr(m->mnt_type, "nfs")) ) ) {
455 continue; 455 continue;
456 } 456 }
457 457
458 if (all == TRUE || flags == 0) { // Allow single mount to override fstab flags 458 if (all || flags == 0) { // Allow single mount to override fstab flags
459 flags = 0; 459 flags = 0;
460 string_flags = string_flags_buf; 460 string_flags = string_flags_buf;
461 *string_flags = '\0'; 461 *string_flags = '\0';
@@ -483,13 +483,13 @@ singlemount:
483 string_flags, useMtab, fakeIt, extra_opts, TRUE, all)) 483 string_flags, useMtab, fakeIt, extra_opts, TRUE, all))
484 rc = EXIT_FAILURE; 484 rc = EXIT_FAILURE;
485 485
486 if (all == FALSE) 486 if (! all)
487 break; 487 break;
488 } 488 }
489 if (fstabmount == TRUE) 489 if (fstabmount)
490 endmntent(f); 490 endmntent(f);
491 491
492 if (all == FALSE && fstabmount == TRUE && m == NULL) 492 if (! all && fstabmount && m == NULL)
493 fprintf(stderr, "Can't find %s in /etc/fstab\n", device); 493 fprintf(stderr, "Can't find %s in /etc/fstab\n", device);
494 494
495 return rc; 495 return rc;