General Public License for more details.
*/
-#include "includes.h"
+#include <sys/types.h>
#include <sys/wait.h>
+#include <unistd.h>
#include "xsystem.h"
#include "libbb/libbb.h"
Otherwise, the 8-bit return value of the program ala WEXITSTATUS
as defined in <sys/wait.h>.
*/
-int
-xsystem(const char *argv[])
+int xsystem(const char *argv[])
{
int status;
pid_t pid;
return -1;
case 0:
/* child */
- execvp(argv[0], (char*const*)argv);
+ execvp(argv[0], (char *const *)argv);
_exit(-1);
default:
/* parent */
if (WIFSIGNALED(status)) {
opkg_msg(ERROR, "%s: Child killed by signal %d.\n",
- argv[0], WTERMSIG(status));
+ argv[0], WTERMSIG(status));
return -1;
}
if (!WIFEXITED(status)) {
/* shouldn't happen */
opkg_msg(ERROR, "%s: Your system is broken: got status %d "
- "from waitpid.\n", argv[0], status);
+ "from waitpid.\n", argv[0], status);
return -1;
}