From 5a07a1d255da10214ddd3cb8dda75bfbfdf46e4c Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Mon, 21 Apr 2008 21:56:07 +0000 Subject: tar: move vfork into separate function (smaller code) open_transformer: more informative error messages function old new delta vfork_compressor - 210 +210 writeTarFile 547 299 -248 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/1 up/down: 210/-248) Total: -38 bytes --- archival/libunarchive/open_transformer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'archival/libunarchive/open_transformer.c') diff --git a/archival/libunarchive/open_transformer.c b/archival/libunarchive/open_transformer.c index 3c551de06..8fb860234 100644 --- a/archival/libunarchive/open_transformer.c +++ b/archival/libunarchive/open_transformer.c @@ -22,11 +22,13 @@ int open_transformer(int src_fd, #if BB_MMU pid = fork(); + if (pid == -1) + bb_perror_msg_and_die("can't fork"); #else pid = vfork(); -#endif if (pid == -1) - bb_perror_msg_and_die("fork failed"); + bb_perror_msg_and_die("can't vfork"); +#endif if (pid == 0) { /* child process */ @@ -49,7 +51,7 @@ int open_transformer(int src_fd, argv[2] = (char*)"-"; argv[3] = NULL; BB_EXECVP(transform_prog, argv); - bb_perror_msg_and_die("exec failed"); + bb_perror_msg_and_die("can't exec %s", transform_prog); } #endif /* notreached */ -- cgit v1.2.3