diff options
Diffstat (limited to 'runit/runit_lib.c')
-rw-r--r-- | runit/runit_lib.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/runit/runit_lib.c b/runit/runit_lib.c index ee69429b2..181d43836 100644 --- a/runit/runit_lib.c +++ b/runit/runit_lib.c | |||
@@ -34,6 +34,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
34 | #include "libbb.h" | 34 | #include "libbb.h" |
35 | #include "runit_lib.h" | 35 | #include "runit_lib.h" |
36 | 36 | ||
37 | #if 0 | ||
37 | /*** buffer.c ***/ | 38 | /*** buffer.c ***/ |
38 | 39 | ||
39 | void buffer_init(buffer *s,int (*op)(int fd,char *buf,unsigned len),int fd,char *buf,unsigned len) | 40 | void buffer_init(buffer *s,int (*op)(int fd,char *buf,unsigned len),int fd,char *buf,unsigned len) |
@@ -231,6 +232,7 @@ int buffer_unixwrite(int fd,char *buf,unsigned len) | |||
231 | { | 232 | { |
232 | return write(fd,buf,len); | 233 | return write(fd,buf,len); |
233 | } | 234 | } |
235 | #endif | ||
234 | 236 | ||
235 | 237 | ||
236 | /*** byte_chr.c ***/ | 238 | /*** byte_chr.c ***/ |
@@ -288,12 +290,14 @@ int fd_move(int to,int from) | |||
288 | } | 290 | } |
289 | 291 | ||
290 | 292 | ||
293 | #if 0 | ||
291 | /*** fifo.c ***/ | 294 | /*** fifo.c ***/ |
292 | 295 | ||
293 | int fifo_make(const char *fn,int mode) | 296 | int fifo_make(const char *fn,int mode) |
294 | { | 297 | { |
295 | return mkfifo(fn,mode); | 298 | return mkfifo(fn, mode); |
296 | } | 299 | } |
300 | #endif | ||
297 | 301 | ||
298 | 302 | ||
299 | /*** fmt_ptime.c ***/ | 303 | /*** fmt_ptime.c ***/ |
@@ -489,7 +493,7 @@ uint64_t taia2millisec(const struct taia *t) | |||
489 | 493 | ||
490 | /* XXX: breaks tai encapsulation */ | 494 | /* XXX: breaks tai encapsulation */ |
491 | 495 | ||
492 | int taia_less(const struct taia *t,const struct taia *u) | 496 | int taia_less(const struct taia *t, const struct taia *u) |
493 | { | 497 | { |
494 | if (t->sec.x < u->sec.x) return 1; | 498 | if (t->sec.x < u->sec.x) return 1; |
495 | if (t->sec.x > u->sec.x) return 0; | 499 | if (t->sec.x > u->sec.x) return 0; |
@@ -537,7 +541,7 @@ void taia_pack(char *s, const struct taia *t) | |||
537 | 541 | ||
538 | /* XXX: breaks tai encapsulation */ | 542 | /* XXX: breaks tai encapsulation */ |
539 | 543 | ||
540 | void taia_sub(struct taia *t,const struct taia *u,const struct taia *v) | 544 | void taia_sub(struct taia *t, const struct taia *u, const struct taia *v) |
541 | { | 545 | { |
542 | unsigned long unano = u->nano; | 546 | unsigned long unano = u->nano; |
543 | unsigned long uatto = u->atto; | 547 | unsigned long uatto = u->atto; |
@@ -560,7 +564,7 @@ void taia_sub(struct taia *t,const struct taia *u,const struct taia *v) | |||
560 | 564 | ||
561 | /* XXX: breaks tai encapsulation */ | 565 | /* XXX: breaks tai encapsulation */ |
562 | 566 | ||
563 | void taia_uint(struct taia *t,unsigned s) | 567 | void taia_uint(struct taia *t, unsigned s) |
564 | { | 568 | { |
565 | t->sec.x = s; | 569 | t->sec.x = s; |
566 | t->nano = 0; | 570 | t->nano = 0; |
@@ -874,6 +878,7 @@ unsigned pmatch(const char *p, const char *s, unsigned len) { | |||
874 | } | 878 | } |
875 | 879 | ||
876 | 880 | ||
881 | #if 0 | ||
877 | /*** prot.c ***/ | 882 | /*** prot.c ***/ |
878 | 883 | ||
879 | int prot_gid(int gid) | 884 | int prot_gid(int gid) |
@@ -887,6 +892,7 @@ int prot_uid(int uid) | |||
887 | { | 892 | { |
888 | return setuid(uid); | 893 | return setuid(uid); |
889 | } | 894 | } |
895 | #endif | ||
890 | 896 | ||
891 | 897 | ||
892 | /*** readclose.c ***/ | 898 | /*** readclose.c ***/ |
@@ -910,6 +916,7 @@ int readclose(int fd,stralloc *sa,unsigned bufsize) | |||
910 | } | 916 | } |
911 | #endif | 917 | #endif |
912 | 918 | ||
919 | #if 0 | ||
913 | /*** scan_ulong.c ***/ | 920 | /*** scan_ulong.c ***/ |
914 | 921 | ||
915 | unsigned scan_ulong(const char *s,unsigned long *u) | 922 | unsigned scan_ulong(const char *s,unsigned long *u) |
@@ -924,6 +931,7 @@ unsigned scan_ulong(const char *s,unsigned long *u) | |||
924 | *u = result; | 931 | *u = result; |
925 | return pos; | 932 | return pos; |
926 | } | 933 | } |
934 | #endif | ||
927 | 935 | ||
928 | 936 | ||
929 | #ifdef UNUSED | 937 | #ifdef UNUSED |
@@ -956,23 +964,23 @@ void sig_block(int sig) | |||
956 | { | 964 | { |
957 | sigset_t ss; | 965 | sigset_t ss; |
958 | sigemptyset(&ss); | 966 | sigemptyset(&ss); |
959 | sigaddset(&ss,sig); | 967 | sigaddset(&ss, sig); |
960 | sigprocmask(SIG_BLOCK,&ss,(sigset_t *) 0); | 968 | sigprocmask(SIG_BLOCK, &ss, NULL); |
961 | } | 969 | } |
962 | 970 | ||
963 | void sig_unblock(int sig) | 971 | void sig_unblock(int sig) |
964 | { | 972 | { |
965 | sigset_t ss; | 973 | sigset_t ss; |
966 | sigemptyset(&ss); | 974 | sigemptyset(&ss); |
967 | sigaddset(&ss,sig); | 975 | sigaddset(&ss, sig); |
968 | sigprocmask(SIG_UNBLOCK,&ss,(sigset_t *) 0); | 976 | sigprocmask(SIG_UNBLOCK, &ss, NULL); |
969 | } | 977 | } |
970 | 978 | ||
971 | void sig_blocknone(void) | 979 | void sig_blocknone(void) |
972 | { | 980 | { |
973 | sigset_t ss; | 981 | sigset_t ss; |
974 | sigemptyset(&ss); | 982 | sigemptyset(&ss); |
975 | sigprocmask(SIG_SETMASK,&ss,(sigset_t *) 0); | 983 | sigprocmask(SIG_SETMASK, &ss, NULL); |
976 | } | 984 | } |
977 | 985 | ||
978 | 986 | ||
@@ -984,7 +992,7 @@ void sig_catch(int sig,void (*f)(int)) | |||
984 | sa.sa_handler = f; | 992 | sa.sa_handler = f; |
985 | sa.sa_flags = 0; | 993 | sa.sa_flags = 0; |
986 | sigemptyset(&sa.sa_mask); | 994 | sigemptyset(&sa.sa_mask); |
987 | sigaction(sig,&sa,(struct sigaction *) 0); | 995 | sigaction(sig,&sa, NULL); |
988 | } | 996 | } |
989 | 997 | ||
990 | 998 | ||