Applications/cat - Added error check
authorJohn Hodge <[email protected]>
Thu, 20 Oct 2011 04:01:10 +0000 (12:01 +0800)
committerJohn Hodge <[email protected]>
Thu, 20 Oct 2011 04:01:10 +0000 (12:01 +0800)
Usermode/Applications/Makefile.tpl
Usermode/Applications/cat_src/main.c

index 1339765..542fd81 100644 (file)
@@ -4,7 +4,7 @@
 #
 
 CFLAGS  += -Wall -Werror -fno-builtin -fno-stack-protector -g
-LDFLAGS += 
+LDFLAGS += -g
 
 _BIN := $(OUTPUTDIR)$(DIR)/$(BIN)
 _OBJPREFIX := obj-$(ARCH)/
index e63a97c..a389c10 100644 (file)
@@ -30,6 +30,7 @@ int main(int argc, char *argv[])
 
        do {
                num = read(fd, buf, BUF_SIZE);
+               if(num < 0)     break;
                buf[num] = '\0';
                printf("%s", buf);
        } while(num == BUF_SIZE);

UCC git Repository :: git.ucc.asn.au