From 603bec779ab8f0751bc48b0394aadd261fafdcde Mon Sep 17 00:00:00 2001 From: graham.gower Date: Mon, 16 Nov 2009 19:17:55 -0500 Subject: Use vfork()/execvp() instead of system(). Parts based on a patch by Mike Westerhof for OpenEmbedded. git-svn-id: http://opkg.googlecode.com/svn/trunk@320 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- (limited to 'libopkg/opkg_install.c') diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c index 02a2be4..5e8596b 100644 --- a/libopkg/opkg_install.c +++ b/libopkg/opkg_install.c @@ -1610,13 +1610,8 @@ static int user_prefers_old_conffile(const char *file_name, const char *backup) } if (strcmp(response, "d") == 0) { - char *cmd; - - free(response); - /* XXX: BUG rewrite to use exec or busybox's internal diff */ - sprintf_alloc(&cmd, "diff -u %s %s", backup, file_name); - xsystem(cmd); - free(cmd); + const char *argv[] = {"diff", "-u", backup, file_name, NULL}; + xsystem(argv); printf(" [Press ENTER to continue]\n"); response = file_read_line_alloc(stdin); free(response); -- cgit v0.9.1