aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-03-31 08:55:48 +0100
committerRon Yorston <rmy@pobox.com>2019-03-31 09:51:00 +0100
commit61e0e3160a8be3ed8488b09200a5dca1bd1b21b4 (patch)
treed55341d875d1dd0d77445960723a47418efd14e5 /libbb
parentbe2949717934c19890879cf2a8fc74c5da55d1c7 (diff)
parent35082fc2c17369223669e099f422acc0982ee4ff (diff)
downloadbusybox-w32-61e0e3160a8be3ed8488b09200a5dca1bd1b21b4.tar.gz
busybox-w32-61e0e3160a8be3ed8488b09200a5dca1bd1b21b4.tar.bz2
busybox-w32-61e0e3160a8be3ed8488b09200a5dca1bd1b21b4.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'libbb')
-rw-r--r--libbb/appletlib.c1
-rw-r--r--libbb/pidfile.c18
2 files changed, 19 insertions, 0 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 58e391fd9..1f1a18aab 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -814,6 +814,7 @@ static int find_script_by_name(const char *name)
814 return -1; 814 return -1;
815} 815}
816 816
817int scripted_main(int argc UNUSED_PARAM, char **argv) MAIN_EXTERNALLY_VISIBLE;
817int scripted_main(int argc UNUSED_PARAM, char **argv) 818int scripted_main(int argc UNUSED_PARAM, char **argv)
818{ 819{
819 int script = find_script_by_name(applet_name); 820 int script = find_script_by_name(applet_name);
diff --git a/libbb/pidfile.c b/libbb/pidfile.c
index a48dfc38b..a6a282562 100644
--- a/libbb/pidfile.c
+++ b/libbb/pidfile.c
@@ -38,3 +38,21 @@ void FAST_FUNC write_pidfile(const char *path)
38 } 38 }
39 close(pid_fd); 39 close(pid_fd);
40} 40}
41
42void FAST_FUNC write_pidfile_std_path_and_ext(const char *name)
43{
44 char buf[sizeof(CONFIG_PID_FILE_PATH) + 64];
45
46 snprintf(buf, sizeof(buf), CONFIG_PID_FILE_PATH"/%s.pid", name);
47 write_pidfile(buf);
48}
49
50void FAST_FUNC remove_pidfile_std_path_and_ext(const char *name)
51{
52 char buf[sizeof(CONFIG_PID_FILE_PATH) + 64];
53
54 if (!wrote_pidfile)
55 return;
56 snprintf(buf, sizeof(buf), CONFIG_PID_FILE_PATH"/%s.pid", name);
57 unlink(buf);
58}