20 |
* Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, |
* Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, |
21 |
* 2001, 2002, 2003, 2004, 2005 by Theodore Ts'o. |
* 2001, 2002, 2003, 2004, 2005 by Theodore Ts'o. |
22 |
* |
* |
23 |
* %Begin-Header% |
* Licensed under GPLv2, see file LICENSE in this tarball for details. |
|
* This file may be redistributed under the terms of the GNU Public |
|
|
* License. |
|
|
* %End-Header% |
|
24 |
*/ |
*/ |
25 |
|
|
26 |
#include <sys/types.h> |
#include <sys/types.h> |
377 |
{ |
{ |
378 |
struct fs_info *fs; |
struct fs_info *fs; |
379 |
|
|
380 |
if (!(fs = malloc(sizeof(struct fs_info)))) |
fs = xmalloc(sizeof(struct fs_info)); |
|
return NULL; |
|
381 |
|
|
382 |
fs->device = string_copy(device); |
fs->device = string_copy(device); |
383 |
fs->mountpt = string_copy(mntpnt); |
fs->mountpt = string_copy(mntpnt); |
572 |
struct fsck_instance *inst, *p; |
struct fsck_instance *inst, *p; |
573 |
pid_t pid; |
pid_t pid; |
574 |
|
|
575 |
inst = malloc(sizeof(struct fsck_instance)); |
inst = xzalloc(sizeof(struct fsck_instance)); |
|
if (!inst) |
|
|
return ENOMEM; |
|
|
memset(inst, 0, sizeof(struct fsck_instance)); |
|
576 |
|
|
577 |
prog = xasprintf("fsck.%s", type); |
prog = xasprintf("fsck.%s", type); |
578 |
argv[0] = prog; |
argv[0] = prog; |
997 |
s = find_fsck(fs->type); |
s = find_fsck(fs->type); |
998 |
if (s == NULL) { |
if (s == NULL) { |
999 |
if (wanted) |
if (wanted) |
1000 |
bb_error_msg("cannot check %s: fsck.%s not found", |
bb_error_msg("can't check %s: fsck.%s not found", |
1001 |
fs->device, fs->type); |
fs->device, fs->type); |
1002 |
return 1; |
return 1; |
1003 |
} |
} |
1199 |
* /proc/partitions isn't found. |
* /proc/partitions isn't found. |
1200 |
*/ |
*/ |
1201 |
if (access("/proc/partitions", R_OK) < 0) { |
if (access("/proc/partitions", R_OK) < 0) { |
1202 |
bb_perror_msg_and_die("cannot open /proc/partitions " |
bb_perror_msg_and_die("can't open /proc/partitions " |
1203 |
"(is /proc mounted?)"); |
"(is /proc mounted?)"); |
1204 |
} |
} |
1205 |
/* |
/* |
1211 |
"must be root to scan for matching filesystems: %s\n", arg); |
"must be root to scan for matching filesystems: %s\n", arg); |
1212 |
else |
else |
1213 |
bb_error_msg_and_die( |
bb_error_msg_and_die( |
1214 |
"cannot find matching filesystem: %s", arg); |
"can't find matching filesystem: %s", arg); |
1215 |
} |
} |
1216 |
devices[num_devices++] = dev ? dev : string_copy(arg); |
devices[num_devices++] = dev ? dev : string_copy(arg); |
1217 |
continue; |
continue; |