aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_install/lib/exec.c
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1993-08-26 01:19:55 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1993-08-26 01:19:55 +0000
commit6d946b2e52275a56dd775436f4c6b6a4c65915c8 (patch)
treeb3cb91ab036ba2deccf4af07caf09c2bf6b4b88e /usr.sbin/pkg_install/lib/exec.c
parent24a82630a20b64577bcc7454bec7288b1dbdb37a (diff)
Notes
Diffstat (limited to 'usr.sbin/pkg_install/lib/exec.c')
-rw-r--r--usr.sbin/pkg_install/lib/exec.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/usr.sbin/pkg_install/lib/exec.c b/usr.sbin/pkg_install/lib/exec.c
new file mode 100644
index 000000000000..6f1a67299b36
--- /dev/null
+++ b/usr.sbin/pkg_install/lib/exec.c
@@ -0,0 +1,48 @@
+#ifndef lint
+static const char *rcsid = "$Id: exec.c,v 1.3 1993/08/24 09:24:04 jkh Exp $";
+#endif
+
+/*
+ * FreeBSD install - a package for the installation and maintainance
+ * of non-core utilities.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Jordan K. Hubbard
+ * 18 July 1993
+ *
+ * Miscellaneous system routines.
+ *
+ */
+
+#include "lib.h"
+
+/*
+ * Unusual system() substitute. Accepts format string and args,
+ * builds and executes command. Returns exit code.
+ */
+
+int
+vsystem(const char *fmt, ...)
+{
+ va_list args;
+ char cmd[FILENAME_MAX * 2]; /* reasonable default for what I do */
+ int ret;
+
+ va_start(args, fmt);
+ vsprintf(cmd, fmt, args);
+#ifdef DEBUG
+printf("Executing %s\n", cmd);
+#endif
+ ret = system(cmd);
+ va_end(args);
+ return ret;
+}
+