diff options
author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2006-04-11 13:54:43 +0000 |
---|---|---|
committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2006-04-11 13:54:43 +0000 |
commit | fdd17ba8402d112738aa90cff51e09b4b9785111 (patch) | |
tree | 167163531402331d26f0046117f1388f83b0750a /package/busybox | |
parent | 67a3f3c98da31b9294b79fca55ce5a60473d3e8a (diff) |
fix segfault in locking utility
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@3617 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/busybox')
-rw-r--r-- | package/busybox/patches/340-lock_util.patch | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/package/busybox/patches/340-lock_util.patch b/package/busybox/patches/340-lock_util.patch index f5c0c2e89e..bb1cf49a77 100644 --- a/package/busybox/patches/340-lock_util.patch +++ b/package/busybox/patches/340-lock_util.patch @@ -39,7 +39,7 @@ diff -urN busybox.old/miscutils/Makefile.in busybox.dev/miscutils/Makefile.in diff -urN busybox.old/miscutils/lock.c busybox.dev/miscutils/lock.c --- busybox.old/miscutils/lock.c 1970-01-01 01:00:00.000000000 +0100 +++ busybox.dev/miscutils/lock.c 2006-04-05 01:07:12.000000000 +0200 -@@ -0,0 +1,125 @@ +@@ -0,0 +1,128 @@ +#include <sys/types.h> +#include <sys/file.h> +#include <sys/stat.h> @@ -77,10 +77,13 @@ diff -urN busybox.old/miscutils/lock.c busybox.dev/miscutils/lock.c + FILE *f; + int i; + -+ f = fopen(file, "r"); ++ if ((f = fopen(file, "r")) == NULL) ++ return 0; ++ + fscanf(f, "%d", &i); + if (i > 0) + kill(i, SIGTERM); ++ + fclose(f); + + return 0; |