summaryrefslogtreecommitdiff
path: root/sys-fs/e2fsprogs
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-01-04 01:27:12 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-01-04 01:27:12 +0000
commit3517852e3b8a68d1e997770fc0650c5053bafc6c (patch)
tree44068672445b1418489aed82de58df3c470289e7 /sys-fs/e2fsprogs
parent0f15659d48c193027158492acb726297501202c5 (diff)
gentoo resync : 04.01.2022
Diffstat (limited to 'sys-fs/e2fsprogs')
-rw-r--r--sys-fs/e2fsprogs/Manifest8
-rw-r--r--sys-fs/e2fsprogs/e2fsprogs-1.46.4.ebuild31
-rw-r--r--sys-fs/e2fsprogs/e2fsprogs-1.46.5.ebuild (renamed from sys-fs/e2fsprogs/e2fsprogs-1.46.4-r51.ebuild)41
-rw-r--r--sys-fs/e2fsprogs/files/fsck_ext2fs.896
-rw-r--r--sys-fs/e2fsprogs/files/fsck_ext2fs.c147
5 files changed, 13 insertions, 310 deletions
diff --git a/sys-fs/e2fsprogs/Manifest b/sys-fs/e2fsprogs/Manifest
index dcab8ead9b93..4d81f250e7f3 100644
--- a/sys-fs/e2fsprogs/Manifest
+++ b/sys-fs/e2fsprogs/Manifest
@@ -1,10 +1,8 @@
AUX e2fsck.conf 138 BLAKE2B b97a754b6aebf1f7fcd4001b720eead61d183eaf5a2c9eb86e8304f5958b034697ac52f4c40b0225c9c404ca7b9fe5bd3f130d9ebf8faf38815050d945524d3c SHA512 d10a8ef566a60815b6f65414d84d23f3ec535c2a93cd780d4425488465f4eff6910c20d0163d1b7d334e9f4c707beab35bf63078b9ec3a5602763ea219bddbef
AUX e2fsprogs-1.40-fbsd.patch 352 BLAKE2B efef09c11bdf6ebeb89819dfefec241919afa17ddee65610332bcd3edbacad4fa501def1d224de39fd6a9979a35e63699b0a2d5e9a2242517122339b68edf6af SHA512 86374e641f958d7c4b53eb44abf7933af064b55a38fef6ca26f848bb63f0c6bf2966852c7cf0770337aef95ff965de95ef282205771e86be36e7ad74e8f81146
AUX e2fsprogs-1.42.13-fix-build-cflags.patch 290 BLAKE2B b37f9fd204bd35631776d68dda5cc9defb5e2bc54e0061778e5bea4886820829605cb092bb40a7f65cd0626d8ffe689bd1c8aad7d29f7c67e5166dd578925ddb SHA512 fed2a8502fafb56a21c88d680a42848bdc8921b228f74842ce3f702279917b6e6c0d1204ee060ea0d2d5ebb02465fc1f3d1a4304068a59b45bf1ddfbdfd46507
-AUX fsck_ext2fs.8 3802 BLAKE2B 379ef7974e29c654e4a69caa64c3703eecf375d63557915bdbfe23c8c0ca67cc9a13792988ba8c0b18bb4ae0819d220102f034499200fd20951e004d34273311 SHA512 639af16c7881bdfca55a9cd39623d3eeb9ae0ca93f8e65321c69ab1b2591cb17cdd0cfc21d27c20b8cc65bd295cccf23e47f740fffb91f4cf17e32959bb166d0
-AUX fsck_ext2fs.c 2793 BLAKE2B 65294fc9026bdb859a58d010f885fdbee2db4372a81b82ffa0722a0a3163885561bf06f0fdb73b4cf8c9cfc5bd0dc0c6ee0a7fb340a2416ce34555eff22f71a4 SHA512 1cac2963c0e85dd6a111bfe2a00f2b4f65c17a05bf0039cec073d4109ad4b0efee8905cff1a25098e0693f367db300054d92598a85dfbe8e5db7ff6419534af6
-DIST e2fsprogs-1.42.9-mint-r1.patch.xz 9012 BLAKE2B ae6421587c3cca2f9b26805c5f8d236d3fecde78cc7df3776ae9c23c7f254d7240e06507568fdd2154a16113c47609a8143535ab9cb2925426d3c578d077ce26 SHA512 591a7c80d65082eebcdc455028be6ade05c9aae96c94f654106be0facef330a8875dae82891e6e3ad2b48dece2b4e1c1940dbc47cd3eba3e6eea3b5ddba9a8fc
DIST e2fsprogs-1.46.4.tar.xz 7035200 BLAKE2B 473f7fd3f521b94cdaa68e37784a518fc1919387dd114f31b5338f1b4c472f86b150229ec3dcae8b73eac95330c0dea729befc8cea08bcf1e455c0b6652d6d2b SHA512 7d9cfdf00ed58e66049585e8382fe4977088956421a0fb8155900c69afd8857309ad2b9301b3f74c9c0afa7287a0ddba2fd1538fcf57858b37a9ab712390016d
-EBUILD e2fsprogs-1.46.4-r51.ebuild 4919 BLAKE2B aa332a2ab98952e301cf139d489b7421e8254c83b18eb9750fc509283fd62c02c2b9b921ddf592229cd1425d4922ef0c31c37b6964390b7cfbd0d9cc700940ec SHA512 afe69970b8f4b5077ed9ca2ced0d8d6d5d61278dc1bc367a90ccf7323544d39228fbe7ba51e35bcde747c34cd915106f864dacfb4fec91f424167ecc546bd666
-EBUILD e2fsprogs-1.46.4.ebuild 4011 BLAKE2B ed9e1b1ff7116c4a07c650978b42aa43801daaa530c191c2e3ed095d5a0f2938a2c4795b78ecddb577325ca3b125bbf6bcb08fbe4e957bf1bfb30cfcb34e4171 SHA512 26ef3f4a84c8fcb2b7a57b5f1377761cb137ad4c6f491de4579709987a1489ebd9f35d9bc00a2f10514483b3c0b0b605150bd6d836322b1c183cab771a7a3005
+DIST e2fsprogs-1.46.5.tar.xz 7040672 BLAKE2B 8d8c02e891c464782a7cff518c41d793fc73366b57e17d80ffc5afd96e6144e354290e667e9710509a9dde4e5dab7e7185c5bf084c5bfd26219f05e5e92e0830 SHA512 53282e1c524f62a95012b1aceef296d494f5238c82c9b08b29fbe6a803dbf7ccfdcd9124eb2f11fe2ff9de26387c78751a92c3217ca414f6db6242098a72d3fa
+EBUILD e2fsprogs-1.46.4.ebuild 3435 BLAKE2B dbb124b159cd882564968c664ee91d2c5db14b814e5baba75cb4f923ec041b4826d280c0b7f633dd11c1bfcc92850182ea7aa3ac63a79d76cdba201bff7bbe7e SHA512 c091444159c4795ae180c966de199016b7cf2de484a95f6123ae11070d72aaa05cb523aa4b28536ba975f3c672a430476269a319843c593c567ba06d7de81671
+EBUILD e2fsprogs-1.46.5.ebuild 4179 BLAKE2B 3f7f98a38ff26f2dedf969356f862ef3d8bd15060b05576dd9ffed1234400bda204e7a6e21437cf5891f40c48145609ffbfc280c10ff2f06a3941b5c53b6aa8f SHA512 afc1ecaca6077ae773fd3b8d71907b6d755ce294ad57e7067c9242c5f874a5ea1c2331a31d9c8ac278085efce0850ca69c0351374544d5f9ac77f5c95ea1a9e8
MISC metadata.xml 782 BLAKE2B 6010ef2af50bc0ec4f7511d28e47cd6f0fc76e3ef88afed222f5a6775e3a1ac51940b2272c37713c0f594b10202391073776f1f8330bc9f45ce0c3a03548f135 SHA512 3a18335967f411f387ecdd066db068d05c90abd1af4a91b226d52a6b9507932528d006ef5e463a423bb635d88b12d81ca1e2d403bd9de2dd12c04a50abc94474
diff --git a/sys-fs/e2fsprogs/e2fsprogs-1.46.4.ebuild b/sys-fs/e2fsprogs/e2fsprogs-1.46.4.ebuild
index 3c09748eee75..225c1d41eb95 100644
--- a/sys-fs/e2fsprogs/e2fsprogs-1.46.4.ebuild
+++ b/sys-fs/e2fsprogs/e2fsprogs-1.46.4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -7,13 +7,12 @@ inherit flag-o-matic systemd toolchain-funcs udev usr-ldscript
DESCRIPTION="Standard EXT2/EXT3/EXT4 filesystem utilities"
HOMEPAGE="http://e2fsprogs.sourceforge.net/"
-SRC_URI="https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v${PV}/${P}.tar.xz
- elibc_mintlib? ( mirror://gentoo/${PN}-1.42.9-mint-r1.patch.xz )"
+SRC_URI="https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v${PV}/${P}.tar.xz"
LICENSE="GPL-2 BSD"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
-IUSE="cron fuse lto nls static-libs +threads elibc_FreeBSD"
+IUSE="cron fuse lto nls static-libs +threads"
RDEPEND="~sys-libs/${PN}-libs-${PV}
>=sys-apps/util-linux-2.16
@@ -35,10 +34,6 @@ PATCHES=(
)
src_prepare() {
- if [[ ${CHOST} == *-mint* ]] ; then
- PATCHES+=( "${WORKDIR}"/${PN}-1.42.9-mint-r1.patch )
- fi
-
default
cp doc/RelNotes/v${PV}.txt ChangeLog || die "Failed to copy Release Notes"
@@ -88,7 +83,7 @@ src_configure() {
)
ac_cv_path_LDCONFIG=: econf "${myeconfargs[@]}"
- if [[ ${CHOST} != *-uclibc ]] && grep -qs 'USE_INCLUDED_LIBINTL.*yes' config.{log,status} ; then
+ if grep -qs 'USE_INCLUDED_LIBINTL.*yes' config.{log,status} ; then
eerror "INTL sanity check failed, aborting build."
eerror "Please post your ${S}/config.log file as an"
eerror "attachment to https://bugs.gentoo.org/show_bug.cgi?id=81096"
@@ -98,12 +93,6 @@ src_configure() {
src_compile() {
emake V=1 COMPILE_ET=compile_et MK_CMDS=mk_cmds
-
- # Build the FreeBSD helper
- if use elibc_FreeBSD ; then
- cp "${FILESDIR}"/fsck_ext2fs.c .
- emake V=1 fsck_ext2fs
- fi
}
src_install() {
@@ -128,16 +117,4 @@ src_install() {
if ! use static-libs ; then
find "${ED}" -name '*.a' -delete || die
fi
-
- if use elibc_FreeBSD ; then
- # Install helpers for us
- into /
- dosbin "${S}"/fsck_ext2fs
- doman "${FILESDIR}"/fsck_ext2fs.8
-
- # filefrag is linux only
- rm \
- "${ED}"/usr/sbin/filefrag \
- "${ED}"/usr/share/man/man8/filefrag.8 || die
- fi
}
diff --git a/sys-fs/e2fsprogs/e2fsprogs-1.46.4-r51.ebuild b/sys-fs/e2fsprogs/e2fsprogs-1.46.5.ebuild
index c5aa51404248..3e84085d14a9 100644
--- a/sys-fs/e2fsprogs/e2fsprogs-1.46.4-r51.ebuild
+++ b/sys-fs/e2fsprogs/e2fsprogs-1.46.5.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -7,17 +7,14 @@ inherit flag-o-matic systemd toolchain-funcs udev usr-ldscript multilib-minimal
DESCRIPTION="Standard EXT2/EXT3/EXT4 filesystem utilities"
HOMEPAGE="http://e2fsprogs.sourceforge.net/"
-SRC_URI="https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v${PV}/${P}.tar.xz
- elibc_mintlib? ( mirror://gentoo/${PN}-1.42.9-mint-r1.patch.xz )"
+SRC_URI="https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v${PV}/${P}.tar.xz"
LICENSE="GPL-2 BSD"
SLOT="0"
-# Unkeyworded for testing unsplitting of e2fsprogs-libs, bug #806875
-#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
-IUSE="cron fuse lto nls static-libs +threads +tools elibc_FreeBSD"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="cron fuse lto nls static-libs +threads +tools"
-RDEPEND="!sys-libs/com_err
- !sys-libs/ss
+RDEPEND="
!sys-libs/${PN}-libs
cron? ( sys-fs/lvm2[-device-mapper-only(-)] )
fuse? ( sys-fs/fuse:0 )
@@ -44,10 +41,6 @@ pkg_setup() {
}
src_prepare() {
- if [[ ${CHOST} == *-mint* ]] ; then
- PATCHES+=( "${WORKDIR}"/${PN}-1.42.9-mint-r1.patch )
- fi
-
default
cp doc/RelNotes/v${PV}.txt ChangeLog || die "Failed to copy Release Notes"
@@ -99,7 +92,7 @@ multilib_src_configure() {
BUILD_LD="$(tc-getBUILD_LD)" \
econf "${myeconfargs[@]}"
- if [[ ${CHOST} != *-uclibc ]] && grep -qs 'USE_INCLUDED_LIBINTL.*yes' config.{log,status} ; then
+ if grep -qs 'USE_INCLUDED_LIBINTL.*yes' config.{log,status} ; then
eerror "INTL sanity check failed, aborting build."
eerror "Please post your ${S}/config.log file as an"
eerror "attachment to https://bugs.gentoo.org/show_bug.cgi?id=81096"
@@ -119,12 +112,6 @@ multilib_src_compile() {
fi
emake V=1
-
- # Build the FreeBSD helper
- if use elibc_FreeBSD ; then
- cp "${FILESDIR}"/fsck_ext2fs.c . || die
- emake V=1 fsck_ext2fs
- fi
}
multilib_src_test() {
@@ -155,12 +142,6 @@ multilib_src_install() {
# Move shared libraries to /lib/, install static libraries to
# /usr/lib/, and install linker scripts to /usr/lib/.
gen_usr_ldscript -a e2p ext2fs
-
- if use elibc_FreeBSD ; then
- # Install helpers for us
- into /
- dosbin "${S}"/fsck_ext2fs
- fi
fi
gen_usr_ldscript -a com_err ss $(usex kernel_linux '' 'uuid blkid')
@@ -177,15 +158,5 @@ multilib_src_install_all() {
if use tools ; then
insinto /etc
doins "${FILESDIR}"/e2fsck.conf
-
- if use elibc_FreeBSD ; then
- into /
- doman "${FILESDIR}"/fsck_ext2fs.8
-
- # filefrag is linux only
- rm \
- "${ED}"/usr/sbin/filefrag \
- "${ED}"/usr/share/man/man8/filefrag.8 || die
- fi
fi
}
diff --git a/sys-fs/e2fsprogs/files/fsck_ext2fs.8 b/sys-fs/e2fsprogs/files/fsck_ext2fs.8
deleted file mode 100644
index aa31cf1db172..000000000000
--- a/sys-fs/e2fsprogs/files/fsck_ext2fs.8
+++ /dev/null
@@ -1,96 +0,0 @@
-.TH fsck_ext2fs 8 2006-07-02 "Matthias Andree" "FreeBSD Ports"
-.\"
-.\" fsck_ext2fs.8 - manual page for fsck_ext2fs wrapper
-.\"
-.\" (C) Copyright 2006 by Matthias Andree <matthias.andree@gmx.de>
-.\"
-.\" License: This file may be redistributed in accordance with the terms
-.\" of the GNU General Public License v2.
-.\"
-.\" Upstream $Id: fsck_ext2fs.8,v 1.3 2006/07/02 11:45:21 emma Exp $
-.\" $FreeBSD: ports/sysutils/e2fsprogs/files/fsck_ext2fs.8,v 1.1 2006/07/04 15:47:51 leeym Exp $
-.\"
-.SH NAME
-.B fsck_ext2fs
-\- compatibility wrapper for e2fsck
-.SH SYNOPSIS
-.P
-.B fsck_ext2fs
-[\fB\-Fpfnyv\fR] [\fB\-b\fR \fIblock\fR]
-.SH DESCRIPTION
-.P
-\fBfsck_ext2fs\fR maps the traditional FreeBSD \fBfsck_ffs\fR options to
-options with the same functionality for \fBe2fsck,\fR runs \fBe2fsck\fR
-and then maps its exit status to values that FreeBSD understands.
-\fBe2fsck\fR is a utility to check and repair ext2 and ext3 file
-systems.
-
-.SH OPTIONS
-.IP \fB\-F\fR
-(check foreground mode required) Immediately exits with status 1 to tell
-\fBfsck\fR that ext2fs cannot be checked in the background. \fBfsck\fR
-usually runs \fBfsck_*\fR programs twice, first with \fB\-F\fR to find
-out if they can do background checking, then either immediately without
-\fB\-F\fR for foreground checking or deferred in the background with
-\fB\-B\fR.
-.IP \fB\-p\fR
-(preen mode) This option suppresses adding the \fB\-f\fR option (unless
-\fB\-f\fR is also given) and adds the \fB\-p\fR option to the
-\fBe2fsck\fR command line. This causes \fBe2fsck\fR to automatically fix
-any filesystem problems that can safely be fixed without operator
-intervention. Without this option given, \fBe2fsck\fR will be run with
-the \fB\-f\fR option to force a check, since interactive scan and repair
-mode is the default on FreeBSD, but not on Linux where \fBe2fsck\fR
-comes from.
-.IP \fB\-f\fR
-(force check) This option forces the check of a clean file system while
-preening and is passed to \fBe2fsck\fR verbatim.
-.IP \fB\-n\fR
-("no" mode) This option causes the file system to be opened in read-only
-mode and assume "no" as answer to all questions. This is the only way to
-safely run \fBfsck\fR on a mounted ext2 or ext3 file system. This option
-is passed to \fBe2fsck\fR verbatim.
-.IP \fB\-y\fR
-("yes" mode) This option is passed verbatim to \fBe2fsck\fR and causes
-it to assume "yes" as answer to all questions. This allows the
-non-interactive use of e2fsck but is rather aggressive. Use with care.
-.IP \fB\-v\fR
-(verbose output) This option is passed verbatim to \fBe2fsck\fR and
-causes it to verbosely report its progress.
-.IP "\fB\-b\fR \fIblock\fR"
-(use alternate super block) This option is passed verbatim to
-\fBe2fsck\fR and selects an alternate super block, for use when the
-primary super block has been damaged. Please see the \fBe2fsck\fR(8)
-manual page for details.
-
-.SH EXIT STATUS
-If errors remain after \fBe2fsck\fR, an invalid option or too many
-options have been specified, \fBe2fsck\fR was killed with a signal or
-the \fIfork\fB system call failed, \fBfsck_ext2fs\fR exits with status
-EXIT_FAILURE (usually 1). If \fBe2fsck\fR cannot be started, exits with
-status 127. If the file system is clean after \fBe2fsck\fR operation,
-exits with status EXIT_SUCCESS (0).
-
-.SH NOTES
-.P
-This utility is merely meant as an adaptor so that \fBe2fsck\fR can be
-run during the boot process, it does not support all options that
-\fBe2fsck\fR offers. If you need one of its advanced options, please run
-\fBe2fsck\fR directly.
-
-.SH FILES
-.TP
-.I /sbin/e2fsck
-is the location of the \fBe2fsck\fR program to run.
-
-.SH AUTHOR
-.P
-Matthias Andree <matthias.andree@gmx.de> wrote the program and this
-manual page.
-.SH CONFORMING TO
-The FreeBSD 6.1 command line interface for \fBfsck_ufs\fR(8).
-.SH SEE ALSO
-.BR fsck (8),
-.BR e2fsck (8)
-and
-.BR fsck_ufs (8).
diff --git a/sys-fs/e2fsprogs/files/fsck_ext2fs.c b/sys-fs/e2fsprogs/files/fsck_ext2fs.c
deleted file mode 100644
index f5e3e5e9a8c9..000000000000
--- a/sys-fs/e2fsprogs/files/fsck_ext2fs.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * fsck_ext2fs - wrapper for e2fsck on FreeBSD
- * Copyright (C) 2004,2006 Matthias Andree <matthias.andree@gmx.de>
- * redistributable in accordance with the
- * GNU General Public License v2
- *
- * $FreeBSD: ports/sysutils/e2fsprogs/files/fsck_ext2fs.c,v 1.5 2006/07/04 15:47:51 leeym Exp $
- *
- * Upstream: $Id: fsck_ext2fs.c,v 1.6 2006/07/02 11:37:49 emma Exp $
- *
- * format: gindent -kr
- */
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <errno.h>
-
-__attribute__ ((noreturn))
-static int die(const char *tag)
-{
- perror(tag);
- exit(EXIT_FAILURE);
-}
-
-int main(int argc, char **argv)
-{
- int ch, i = 1, force = 0, status, verbose = 0, t;
- long block = 0;
- enum { normal, preen, yes, no } mode = normal;
- char *cmd[256];
- pid_t pid;
-
- cmd[0] = "/sbin/e2fsck";
- while ((ch = getopt(argc, argv, "BFpfnyb:v")) != -1) {
- switch (ch) {
- case 'p':
- mode = preen;
- break;
- case 'f':
- force = 1;
- break;
- case 'n':
- mode = no;
- break;
- case 'y':
- mode = yes;
- break;
- case 'b':
- block = atol(optarg);
- break;
- case 'v':
- verbose++;
- break;
- case 'F':
- /* e2fsck does not support background checking,
- * hence exit with nonzero status to force
- * the foreground check. */
- exit(1);
- case 'B':
- default:
- fprintf(stderr, "%s: unknown option -%c\n",
- argv[0], optopt);
- exit(EXIT_FAILURE);
- }
- }
-
- if (force)
- cmd[i++] = "-f";
-
- switch (mode) {
- case normal:
- /* FreeBSD needs -f to force a check only in context
- * with -p -- so map normal to force to match
- * expectations */
- if (!force)
- cmd[i++] = "-f";
- break;
- case yes:
- cmd[i++] = "-y";
- break;
- case no:
- cmd[i++] = "-n";
- break;
- case preen:
- cmd[i++] = "-p";
- break;
- }
-
- if (block) {
- static char b[30];
-
- sprintf(b, "-b %ld", block);
- cmd[i++] = b;
- }
-
- /* silently limit verbose to 15 so we don't overflow the cmd array */
- if (verbose > 15)
- verbose = 15;
-
- for (t = verbose; t > 1; t--)
- cmd[i++] = "-v";
-
- while (optind < argc) {
- cmd[i++] = argv[optind++];
- /* sanity check so we don't overflow the cmd buffer */
- if (i+1 == sizeof(cmd)/sizeof(cmd[0])) {
- errno = E2BIG;
- die(argv[0]);
- }
- }
-
- cmd[i++] = 0;
-
- if (verbose) {
- for (i=0; cmd[i]; i++)
- fputs(cmd[i], stderr),
- fputc(' ', stderr);
- fputc('\n', stderr);
- }
-
- pid = fork();
- switch (pid) {
- case -1:
- /* error */
- die("fork");
- break;
- case 0:
- /* child */
- (void) execv(cmd[0], cmd);
- perror("execve");
- _exit(127);
- default:
- /* parent */
- if (pid != waitpid(pid, &status, 0))
- die("waitpid");
- if (WIFSIGNALED(status)
- || (WIFEXITED(status) && WEXITSTATUS(status) >= 4))
- exit(EXIT_FAILURE);
- }
- exit(EXIT_SUCCESS);
-}