summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 92bf033)
raw | patch | inline | side by side (parent: 92bf033)
| author | Jim Meyering <meyering@redhat.com> | |
| Sat, 7 Nov 2009 15:47:37 +0000 (16:47 +0100) | ||
| committer | Jim Meyering <meyering@redhat.com> | |
| Sat, 7 Nov 2009 15:53:00 +0000 (16:53 +0100) |
Convert all uses automatically, via these two commands:
git grep -l '\<exit *(1)'|xargs --no-run-if-empty \
perl -pi -e 's/\b(exit ?)\(1\)/$1(EXIT_FAILURE)/'
git grep -l '\<exit *(0)'|xargs --no-run-if-empty \
perl -pi -e 's/\b(exit ?)\(0\)/$1(EXIT_SUCCESS)/'
* libparted/fs/fat/table.c (fat_table_get): Use symbolic exit codes.
* libparted/labels/vtoc.c (vtoc_update_format5_label_add): Likewise.
(vtoc_update_format5_label_del): Likewise.
(vtoc_update_format7_label_add): Likewise.
(vtoc_update_format7_label_del): Likewise.
* m4/parted.m4 (PARTED_CHECK_LIBPARTED): Likewise.
* parted/parted.c (do_quit): Likewise.
* parted/strlist.c (gettext_to_wchar, wchar_to_str): Likewise.
* parted/ui.c (reset_env, help_msg, non_interactive_mode): Likewise.
git grep -l '\<exit *(1)'|xargs --no-run-if-empty \
perl -pi -e 's/\b(exit ?)\(1\)/$1(EXIT_FAILURE)/'
git grep -l '\<exit *(0)'|xargs --no-run-if-empty \
perl -pi -e 's/\b(exit ?)\(0\)/$1(EXIT_SUCCESS)/'
* libparted/fs/fat/table.c (fat_table_get): Use symbolic exit codes.
* libparted/labels/vtoc.c (vtoc_update_format5_label_add): Likewise.
(vtoc_update_format5_label_del): Likewise.
(vtoc_update_format7_label_add): Likewise.
(vtoc_update_format7_label_del): Likewise.
* m4/parted.m4 (PARTED_CHECK_LIBPARTED): Likewise.
* parted/parted.c (do_quit): Likewise.
* parted/strlist.c (gettext_to_wchar, wchar_to_str): Likewise.
* parted/ui.c (reset_env, help_msg, non_interactive_mode): Likewise.
--- a/libparted/fs/fat/table.c
+++ b/libparted/fs/fat/table.c
_("fat_table_get: cluster %ld outside "
"file system"),
(long) cluster);
- exit (1); /* FIXME */
+ exit (EXIT_FAILURE); /* FIXME */
}
switch (ft->fat_type) {
--- a/libparted/labels/vtoc.c
+++ b/libparted/labels/vtoc.c
{
puts ("BUG: overlapping free space extents "
"in FMT5 DSCB!\nexiting...");
- exit(1);
+ exit(EXIT_FAILURE);
}
if ((ext->t + ext->fc + ext->ft) == 0x0000) {
if (tmp == NULL) {
/* BUG: no free extent found */
puts ("BUG: no free FMT5 DSCB extent found!\nexiting...");
- exit(1);
+ exit(EXIT_FAILURE);
}
for (i=0; i<26; i++) {
puts ("BUG: corresponding free space extent "
"doesn't match free space currently shown "
"in FMT5 DSCB!\nexiting...");
- exit(1);
+ exit(EXIT_FAILURE);
}
if ((a > ext->t) && (a < ext->t + ext->fc*trk + ext->ft)
"deleting doesn't match free space "
"currently shown in FMT5 DSCB!\n"
"exiting...");
- exit(1);
+ exit(EXIT_FAILURE);
}
}
puts ("BUG: specified free space extent for "
"deleting not found in FMT5 DSCB!\n"
"exiting...");
- exit(1);
+ exit(EXIT_FAILURE);
}
/*
{
puts ("BUG: overlapping free space extents "
"in FMT7 DSCB!\nexiting...");
- exit(1);
+ exit(EXIT_FAILURE);
}
if ((ext->a + ext->b) == 0x00000000) {
if (tmp == NULL) {
/* BUG: no free extent found */
puts ("BUG: no free FMT7 DSCB extent found!\nexiting...");
- exit(1);
+ exit(EXIT_FAILURE);
}
for (i=0; i<16; i++) {
"doesn't match free space currently shown in "
"FMT7 DSCB!\nexiting...");
printf ("%d %d %d %d\n", a, b, ext->a, ext->b);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
puts ("BUG: specified free space extent for "
"deleting not found in FMT7 DSCB!\n"
"exiting...");
- exit(1);
+ exit(EXIT_FAILURE);
}
void
diff --git a/m4/parted.m4 b/m4/parted.m4
--- a/m4/parted.m4
+++ b/m4/parted.m4
const char *version;
if ( !(version = ped_get_version ()) )
- exit(1);
+ exit(EXIT_FAILURE);
if (sscanf(version, "%d.%d.%d", &major, &minor, µ) != 3) {
printf("%s, bad version string\n", version);
- exit(1);
+ exit(EXIT_FAILURE);
}
if ((major > $parted_config_major_version) ||
diff --git a/parted/parted.c b/parted/parted.c
--- a/parted/parted.c
+++ b/parted/parted.c
do_quit (PedDevice** dev)
{
_done (*dev);
- exit (0);
+ exit (EXIT_SUCCESS);
}
static PedPartitionType
diff --git a/parted/strlist.c b/parted/strlist.c
--- a/parted/strlist.c
+++ b/parted/strlist.c
error:
printf ("Error during translation: %s\n", strerror (errno));
- exit (1);
+ exit (EXIT_FAILURE);
}
#else /* ENABLE_NLS */
error:
printf ("Error during translation: %s\n", strerror (errno));
- exit (1);
+ exit (EXIT_FAILURE);
}
#else /* ENABLE_NLS */
diff --git a/parted/ui.c b/parted/ui.c
--- a/parted/ui.c
+++ b/parted/ui.c
if (in_readline) {
putchar ('\n');
if (quit)
- exit (0);
+ exit (EXIT_SUCCESS);
siglongjmp (readline_state.jmp_state, 1);
}
fputs (_("COMMANDs:"), stdout);
putchar ('\n');
print_commands_help ();
- exit (0);
+ exit (EXIT_SUCCESS);
}
void
if (!(cmd->non_interactive)) {
fputs(_("This command does not make sense in "
"non-interactive mode.\n"), stdout);
- exit(1);
+ exit(EXIT_FAILURE);
goto error;
}
