From 23f4110ba2c575f91f13e18812c3f3ce1c49c400 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Wed, 15 Mar 2017 08:52:39 -0400 Subject: [PATCH] moved writall to print.c and removed system.c --- Makefile | 2 +- print.c | 9 +++++++++ system.c | 10 ---------- 3 files changed, 10 insertions(+), 11 deletions(-) delete mode 100644 system.c diff --git a/Makefile b/Makefile index f9df459..f584a26 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ CC = c99 CPPFLAGS = -I. CCCMD = $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) -RCOBJS = builtins.o except.o exec.o fn.o footobar.o glob.o glom.o hash.o heredoc.o input.o lex.o list.o main.o match.o nalloc.o open.o y.tab.o print.o redir.o signal.o status.o tree.o utils.o var.o wait.o walk.o which.o sigmsgs.o system.o +RCOBJS = builtins.o except.o exec.o fn.o footobar.o glob.o glom.o hash.o heredoc.o input.o lex.o list.o main.o match.o nalloc.o open.o y.tab.o print.o redir.o signal.o status.o tree.o utils.o var.o wait.o walk.o which.o sigmsgs.o all: rc diff --git a/print.c b/print.c index 6ab0455..f948f43 100644 --- a/print.c +++ b/print.c @@ -364,3 +364,12 @@ extern char *nprint(const char *fmt,...) { va_end(format.args); return result; } + +extern void writeall(int fd, char *buf, size_t remain) { + int i; + + for (i = 0; remain > 0; buf += i, remain -= i) + if ((i = write(fd, buf, remain)) <= 0) + break; /* abort silently on errors in write() */ + sigchk(); +} \ No newline at end of file diff --git a/system.c b/system.c deleted file mode 100644 index edc0e0f..0000000 --- a/system.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "rc.h" - -extern void writeall(int fd, char *buf, size_t remain) { - int i; - - for (i = 0; remain > 0; buf += i, remain -= i) - if ((i = write(fd, buf, remain)) <= 0) - break; /* abort silently on errors in write() */ - sigchk(); -} -- 2.49.0