ifupdown: save some 100+ bytes of code in addstr()
[oweals/busybox.git] / runit / runit_lib.c
index 322bef858c03a4ca89ca23c18287e6f695ffc57a..5ebbc58406adbbc0619cab0f354cddcd72cf38d3 100644 (file)
@@ -34,10 +34,6 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "libbb.h"
 #include "runit_lib.h"
 
-#ifndef O_NONBLOCK
-#define O_NONBLOCK O_NDELAY
-#endif
-
 /*** buffer.c ***/
 
 void buffer_init(buffer *s,int (*op)(int fd,char *buf,unsigned len),int fd,char *buf,unsigned len)
@@ -519,6 +515,7 @@ void taia_uint(struct taia *t,unsigned s)
 
 
 /*** stralloc_cat.c ***/
+#if 0
 
 int stralloc_cat(stralloc *sato,const stralloc *safrom)
 {
@@ -577,6 +574,7 @@ int stralloc_copys(stralloc *sa,const char *s)
 
 GEN_ALLOC_append(stralloc,char,s,len,a,i,n,x,30,stralloc_readyplus,stralloc_append)
 
+#endif /* stralloc */
 
 /*** iopause.c ***/
 
@@ -623,27 +621,11 @@ int lock_exnb(int fd)
 }
 
 
-/*** ndelay_off.c ***/
-
-int ndelay_off(int fd)
-{
-       return fcntl(fd,F_SETFL,fcntl(fd,F_GETFL,0) & ~O_NONBLOCK);
-}
-
-
-/*** ndelay_on.c ***/
-
-int ndelay_on(int fd)
-{
-       return fcntl(fd,F_SETFL,fcntl(fd,F_GETFL,0) | O_NONBLOCK);
-}
-
-
 /*** open_append.c ***/
 
 int open_append(const char *fn)
 {
-       return open(fn,O_WRONLY | O_NDELAY | O_APPEND | O_CREAT,0600);
+       return open(fn, O_WRONLY|O_NDELAY|O_APPEND|O_CREAT, 0600);
 }
 
 
@@ -651,7 +633,7 @@ int open_append(const char *fn)
 
 int open_read(const char *fn)
 {
-       return open(fn,O_RDONLY | O_NDELAY);
+       return open(fn, O_RDONLY|O_NDELAY);
 }
 
 
@@ -667,12 +649,12 @@ int open_trunc(const char *fn)
 
 int open_write(const char *fn)
 {
-       return open(fn,O_WRONLY | O_NDELAY);
+       return open(fn, O_WRONLY|O_NDELAY);
 }
 
 
 /*** openreadclose.c ***/
-
+#if 0
 int openreadclose(const char *fn,stralloc *sa,unsigned bufsize)
 {
        int fd;
@@ -684,10 +666,11 @@ int openreadclose(const char *fn,stralloc *sa,unsigned bufsize)
        if (readclose(fd,sa,bufsize) == -1) return -1;
        return 1;
 }
+#endif
 
 
 /*** pathexec_env.c ***/
-
+#if 0
 static stralloc plus;
 static stralloc tmp;
 
@@ -748,10 +731,10 @@ void pathexec(char **argv)
        pathexec_run(*argv,argv,e);
        free(e);
 }
-
+#endif
 
 /*** pathexec_run.c ***/
-
+#if 0
 static stralloc tmp;
 
 void pathexec_run(const char *file,char *const *argv,char *const *envp)
@@ -792,7 +775,7 @@ void pathexec_run(const char *file,char *const *argv,char *const *envp)
                path += 1;
        }
 }
-
+#endif
 
 /*** pmatch.c ***/
 
@@ -853,7 +836,7 @@ int prot_uid(int uid)
 
 
 /*** readclose.c ***/
-
+#if 0
 int readclose_append(int fd,stralloc *sa,unsigned bufsize)
 {
        int r;
@@ -871,7 +854,7 @@ int readclose(int fd,stralloc *sa,unsigned bufsize)
        if (!stralloc_copys(sa,"")) { close(fd); return -1; }
        return readclose_append(fd,sa,bufsize);
 }
-
+#endif
 
 /*** scan_ulong.c ***/