#include "libbb.h"
#include "runit_lib.h"
+#if 0
/*** buffer.c ***/
void buffer_init(buffer *s,int (*op)(int fd,char *buf,unsigned len),int fd,char *buf,unsigned len)
{
return write(fd,buf,len);
}
+#endif
/*** byte_chr.c ***/
}
+#if 0
/*** fifo.c ***/
int fifo_make(const char *fn,int mode)
{
- return mkfifo(fn,mode);
+ return mkfifo(fn, mode);
}
+#endif
/*** fmt_ptime.c ***/
/* XXX: breaks tai encapsulation */
-int taia_less(const struct taia *t,const struct taia *u)
+int taia_less(const struct taia *t, const struct taia *u)
{
if (t->sec.x < u->sec.x) return 1;
if (t->sec.x > u->sec.x) return 0;
/* XXX: breaks tai encapsulation */
-void taia_sub(struct taia *t,const struct taia *u,const struct taia *v)
+void taia_sub(struct taia *t, const struct taia *u, const struct taia *v)
{
unsigned long unano = u->nano;
unsigned long uatto = u->atto;
/* XXX: breaks tai encapsulation */
-void taia_uint(struct taia *t,unsigned s)
+void taia_uint(struct taia *t, unsigned s)
{
t->sec.x = s;
t->nano = 0;
}
+#if 0
/*** prot.c ***/
int prot_gid(int gid)
{
return setuid(uid);
}
+#endif
/*** readclose.c ***/
}
#endif
+#if 0
/*** scan_ulong.c ***/
unsigned scan_ulong(const char *s,unsigned long *u)
*u = result;
return pos;
}
+#endif
#ifdef UNUSED
{
sigset_t ss;
sigemptyset(&ss);
- sigaddset(&ss,sig);
- sigprocmask(SIG_BLOCK,&ss,(sigset_t *) 0);
+ sigaddset(&ss, sig);
+ sigprocmask(SIG_BLOCK, &ss, NULL);
}
void sig_unblock(int sig)
{
sigset_t ss;
sigemptyset(&ss);
- sigaddset(&ss,sig);
- sigprocmask(SIG_UNBLOCK,&ss,(sigset_t *) 0);
+ sigaddset(&ss, sig);
+ sigprocmask(SIG_UNBLOCK, &ss, NULL);
}
void sig_blocknone(void)
{
sigset_t ss;
sigemptyset(&ss);
- sigprocmask(SIG_SETMASK,&ss,(sigset_t *) 0);
+ sigprocmask(SIG_SETMASK, &ss, NULL);
}
sa.sa_handler = f;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
- sigaction(sig,&sa,(struct sigaction *) 0);
+ sigaction(sig,&sa, NULL);
}
/*** buffer.h ***/
+#if 0
typedef struct buffer {
char *x;
unsigned p;
int (*op)(int fd,char *buf,unsigned len);
} buffer;
-#define BUFFER_INIT(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
-#define BUFFER_INSIZE 8192
+//#define BUFFER_INIT(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
+//#define BUFFER_INSIZE 8192
#define BUFFER_OUTSIZE 8192
extern void buffer_init(buffer *,int (*)(int fd,char *buf,unsigned len),int,char *,unsigned);
extern int buffer_flush(buffer *);
-extern int buffer_put(buffer *,const char *,unsigned);
+//extern int buffer_put(buffer *,const char *,unsigned);
extern int buffer_putalign(buffer *,const char *,unsigned);
extern int buffer_putflush(buffer *,const char *,unsigned);
-extern int buffer_puts(buffer *,const char *);
+//extern int buffer_puts(buffer *,const char *);
extern int buffer_putsalign(buffer *,const char *);
extern int buffer_putsflush(buffer *,const char *);
/* Actually, int buffer_unixwrite(int,const char *,unsigned),
but that 'const' will produce warnings... oh well */
extern int buffer_unixwrite(int,char *,unsigned);
+#endif
/*** byte.h ***/
/*** fifo.h ***/
-extern int fifo_make(const char *,int);
+//extern int fifo_make(const char *,int);
/*** fmt.h ***/
/*** pathexec.h ***/
-extern void pathexec_run(const char *,char *const *,char *const *);
-extern int pathexec_env(const char *,const char *);
-extern void pathexec(char **);
+//extern void pathexec_run(const char *,char *const *,char *const *);
+//extern int pathexec_env(const char *,const char *);
+//extern void pathexec(char **);
/*** pmatch.h ***/
/*** prot.h ***/
-extern int prot_gid(int);
-extern int prot_uid(int);
+//extern int prot_gid(int);
+//extern int prot_uid(int);
/*** readclose.h ***/
/*** seek.h ***/
-typedef unsigned long seek_pos;
+//typedef unsigned long seek_pos;
-extern seek_pos seek_cur(int);
+//extern seek_pos seek_cur(int);
//extern int seek_set(int,seek_pos);
-extern int seek_end(int);
+//extern int seek_end(int);
-extern int seek_trunc(int,seek_pos);
+//extern int seek_trunc(int,seek_pos);
//#define seek_begin(fd) (seek_set((fd),(seek_pos) 0))
//extern int sig_term;
extern void sig_catch(int,void (*)(int));
-#define sig_ignore(s) (sig_catch((s),SIG_IGN))
-#define sig_uncatch(s) (sig_catch((s),SIG_DFL))
+#define sig_ignore(s) (sig_catch((s), SIG_IGN))
+#define sig_uncatch(s) (sig_catch((s), SIG_DFL))
extern void sig_block(int);
extern void sig_unblock(int);
extern unsigned str_chr(const char *,int); /* never returns NULL */
-#define str_diff(s,t) strcmp((s),(t))
-#define str_equal(s,t) (!strcmp((s),(t)))
+#define str_diff(s,t) strcmp((s), (t))
+#define str_equal(s,t) (!strcmp((s), (t)))
/*** wait.h ***/
coe(svd[1].fdlock);
}
- fifo_make("log/supervise/control"+4, 0600);
+ mkfifo("log/supervise/control"+4, 0600);
svd[0].fdcontrol = xopen("log/supervise/control"+4, O_RDONLY|O_NDELAY);
coe(svd[0].fdcontrol);
svd[0].fdcontrolwrite = xopen("log/supervise/control"+4, O_WRONLY|O_NDELAY);
coe(svd[0].fdcontrolwrite);
update_status(&svd[0]);
if (haslog) {
- fifo_make("log/supervise/control", 0600);
+ mkfifo("log/supervise/control", 0600);
svd[1].fdcontrol = xopen("log/supervise/control", O_RDONLY|O_NDELAY);
coe(svd[1].fdcontrol);
svd[1].fdcontrolwrite = xopen("log/supervise/control", O_WRONLY|O_NDELAY);
coe(svd[1].fdcontrolwrite);
update_status(&svd[1]);
}
- fifo_make("log/supervise/ok"+4, 0600);
+ mkfifo("log/supervise/ok"+4, 0600);
fd = xopen("log/supervise/ok"+4, O_RDONLY|O_NDELAY);
coe(fd);
if (haslog) {
- fifo_make("log/supervise/ok", 0600);
+ mkfifo("log/supervise/ok", 0600);
fd = xopen("log/supervise/ok", O_RDONLY|O_NDELAY);
coe(fd);
}