aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-05-31 22:16:38 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-05-31 22:16:38 +0000
commitfad2b86c9e7eaadb973b50a1bc0e2accc1a96cfd (patch)
treef2d3fe127fb6c3c1d3b919631de6e6ed7cbc1791 /libbb
parentc2f011aa031b8598422953d5e9a93ca008ad0867 (diff)
downloadbusybox-w32-fad2b86c9e7eaadb973b50a1bc0e2accc1a96cfd.tar.gz
busybox-w32-fad2b86c9e7eaadb973b50a1bc0e2accc1a96cfd.tar.bz2
busybox-w32-fad2b86c9e7eaadb973b50a1bc0e2accc1a96cfd.zip
use "glibc errno" trick not only for ash, but for entire busybox
(add/remove: 1/1 grow/shrink: 37/37 up/down: 139/-228) Total: -89 bytes
Diffstat (limited to 'libbb')
-rw-r--r--libbb/error_msg.c4
-rw-r--r--libbb/perror_msg.c4
-rw-r--r--libbb/run_shell.c13
-rw-r--r--libbb/safe_write.c5
4 files changed, 3 insertions, 23 deletions
diff --git a/libbb/error_msg.c b/libbb/error_msg.c
index b2141f3a2..5f53f0311 100644
--- a/libbb/error_msg.c
+++ b/libbb/error_msg.c
@@ -7,10 +7,6 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 */ 8 */
9 9
10#include <stdio.h>
11#include <errno.h>
12#include <string.h>
13#include <stdlib.h>
14#include "libbb.h" 10#include "libbb.h"
15 11
16void bb_error_msg(const char *s, ...) 12void bb_error_msg(const char *s, ...)
diff --git a/libbb/perror_msg.c b/libbb/perror_msg.c
index 7fb0830be..5145795f5 100644
--- a/libbb/perror_msg.c
+++ b/libbb/perror_msg.c
@@ -7,10 +7,6 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 */ 8 */
9 9
10#include <stdio.h>
11#include <errno.h>
12#include <string.h>
13#include <stdlib.h>
14#include "libbb.h" 10#include "libbb.h"
15 11
16void bb_perror_msg(const char *s, ...) 12void bb_perror_msg(const char *s, ...)
diff --git a/libbb/run_shell.c b/libbb/run_shell.c
index 6be09088d..25d55dd63 100644
--- a/libbb/run_shell.c
+++ b/libbb/run_shell.c
@@ -28,19 +28,12 @@
28 * SUCH DAMAGE. 28 * SUCH DAMAGE.
29 */ 29 */
30 30
31#include <stdio.h>
32#include <errno.h>
33#include <unistd.h>
34#include <string.h>
35#include <stdlib.h>
36#include <syslog.h>
37#include <ctype.h>
38#include "libbb.h" 31#include "libbb.h"
39#ifdef CONFIG_SELINUX 32#if ENABLE_SELINUX
40#include <selinux/selinux.h> /* for setexeccon */ 33#include <selinux/selinux.h> /* for setexeccon */
41#endif 34#endif
42 35
43#ifdef CONFIG_SELINUX 36#if ENABLE_SELINUX
44static security_context_t current_sid; 37static security_context_t current_sid;
45 38
46void 39void
@@ -90,7 +83,7 @@ void run_shell(const char *shell, int loginshell, const char *command, const cha
90 args[argno++] = *additional_args; 83 args[argno++] = *additional_args;
91 } 84 }
92 args[argno] = NULL; 85 args[argno] = NULL;
93#ifdef CONFIG_SELINUX 86#if ENABLE_SELINUX
94 if (current_sid && !setexeccon(current_sid)) { 87 if (current_sid && !setexeccon(current_sid)) {
95 freecon(current_sid); 88 freecon(current_sid);
96 execve(shell, (char **) args, environ); 89 execve(shell, (char **) args, environ);
diff --git a/libbb/safe_write.c b/libbb/safe_write.c
index c81f1247f..5bbb82e84 100644
--- a/libbb/safe_write.c
+++ b/libbb/safe_write.c
@@ -7,13 +7,8 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 */ 8 */
9 9
10#include <stdio.h>
11#include <errno.h>
12#include <unistd.h>
13#include "libbb.h" 10#include "libbb.h"
14 11
15
16
17ssize_t safe_write(int fd, const void *buf, size_t count) 12ssize_t safe_write(int fd, const void *buf, size_t count)
18{ 13{
19 ssize_t n; 14 ssize_t n;