Bug 441

Summary: Add setlock and -L and -l support to runit/chpst.c
Product: Busybox Reporter: Earl Chew <echew>
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: enhancement CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Host: Target:
Build:
Attachments: Patch to add locking functionality
Patch of chpst.c against more recent version

Description Earl Chew 2009-07-04 16:38:35 UTC
Add setlock to chpst.c
Comment 1 Earl Chew 2009-07-04 16:39:30 UTC
Created attachment 447 [details]
Patch to add locking functionality
Comment 2 Denys Vlasenko 2009-07-05 23:22:47 UTC
Does not apply to current git:

# patch -p0 </.2/dl/runit.diff
patching file runit/chpst.c
Hunk #1 FAILED at 32.
Hunk #2 FAILED at 57.
Hunk #3 FAILED at 185.
Hunk #4 FAILED at 309.
Hunk #5 FAILED at 317.
Hunk #6 FAILED at 326.
Hunk #7 FAILED at 343.
Hunk #8 FAILED at 369.
Hunk #9 FAILED at 413.
9 out of 9 hunks FAILED -- saving rejects to file runit/chpst.c.rej
patching file runit/Config.in
Hunk #1 succeeded at 62 (offset 17 lines).
patching file include/applets.h
Hunk #1 FAILED at 314.
1 out of 1 hunk FAILED -- saving rejects to file include/applets.h.rej
patching file include/usage.h
Hunk #1 FAILED at 366.
Hunk #2 FAILED at 377.
Hunk #3 FAILED at 406.
3 out of 3 hunks FAILED -- saving rejects to file include/usage.h.rej

Can you rediff it against current git?
Comment 3 Earl Chew 2009-07-10 05:36:30 UTC
(In reply to comment #2)
> Can you rediff it against current git?

Working on it.
Comment 4 Earl Chew 2009-08-02 14:42:49 UTC
Created attachment 559 [details]
Patch of chpst.c against more recent version
Comment 5 Denys Vlasenko 2009-08-22 17:45:05 UTC
> Patch of chpst.c against more recent version

Which version exactly?


--- chpst.c.orig        2009-07-09 13:58:01.000000000 -0700
+++ chpst.c.new     2009-08-02 07:40:58.000000000 -0700

There is no chpst.c.new file in the tree. Thus, patch can't be applied without hand-fixing.

Generally, patches should be in this format:

diff -d -urpN busybox.0/miscutils/beep.c busybox.1/miscutils/beep.c
--- busybox.0/miscutils/beep.c  2009-08-22 14:52:14.000000000 +0200
+++ busybox.1/miscutils/beep.c  2009-08-22 17:57:53.000000000 +0200

so that they apply cleanly with "patch -p1 <patch" in the top directory of the source tree.


After fixing that, I got:

# patch -p0 </tmp/chpst.diff
patching file chpst.c
Hunk #6 FAILED at 202.
1 out of 7 hunks FAILED -- saving rejects to file chpst.c.rej
Comment 6 Denys Vlasenko 2009-08-22 17:46:24 UTC
The tree to base patch on can be obtained using

git clone git://busybox.net/busybox.git