aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2012-05-09 15:23:38 +0100
committerRon Yorston <rmy@pobox.com>2012-05-09 15:23:38 +0100
commit7e572c27e15f5ca458dd02a745b20d1dbbc9f1f6 (patch)
tree2ff84ec9c7249a0a370da7cb187ac99ca5033863 /libbb
parent4066aff5e481941585c5958460c39a1b1399ce88 (diff)
parentf1f8fcaad556ea2991e57bbb6132d80e86346e1e (diff)
downloadbusybox-w32-7e572c27e15f5ca458dd02a745b20d1dbbc9f1f6.tar.gz
busybox-w32-7e572c27e15f5ca458dd02a745b20d1dbbc9f1f6.tar.bz2
busybox-w32-7e572c27e15f5ca458dd02a745b20d1dbbc9f1f6.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'libbb')
-rw-r--r--libbb/kernel_version.c11
-rw-r--r--libbb/remove_file.c2
2 files changed, 5 insertions, 8 deletions
diff --git a/libbb/kernel_version.c b/libbb/kernel_version.c
index a168a1e4e..738ed022b 100644
--- a/libbb/kernel_version.c
+++ b/libbb/kernel_version.c
@@ -20,18 +20,15 @@
20int FAST_FUNC get_linux_version_code(void) 20int FAST_FUNC get_linux_version_code(void)
21{ 21{
22 struct utsname name; 22 struct utsname name;
23 char *s; 23 char *s, *t;
24 int i, r; 24 int i, r;
25 25
26 if (uname(&name) == -1) { 26 uname(&name); /* never fails */
27 bb_perror_msg("can't get system information");
28 return 0;
29 }
30
31 s = name.release; 27 s = name.release;
32 r = 0; 28 r = 0;
33 for (i = 0; i < 3; i++) { 29 for (i = 0; i < 3; i++) {
34 r = r * 256 + atoi(strtok(s, ".")); 30 t = strtok(s, ".");
31 r = r * 256 + (t ? atoi(t) : 0);
35 s = NULL; 32 s = NULL;
36 } 33 }
37 return r; 34 return r;
diff --git a/libbb/remove_file.c b/libbb/remove_file.c
index c6531a0b9..5b75f7f30 100644
--- a/libbb/remove_file.c
+++ b/libbb/remove_file.c
@@ -33,7 +33,7 @@ int FAST_FUNC remove_file(const char *path, int flags)
33 int status = 0; 33 int status = 0;
34 34
35 if (!(flags & FILEUTILS_RECUR)) { 35 if (!(flags & FILEUTILS_RECUR)) {
36 bb_error_msg("%s: is a directory", path); 36 bb_error_msg("'%s' is a directory", path);
37 return -1; 37 return -1;
38 } 38 }
39 39