git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Oops
[tpg/acess2.git]
/
Usermode
/
Applications
/
cat_src
/
main.c
diff --git
a/Usermode/Applications/cat_src/main.c
b/Usermode/Applications/cat_src/main.c
index
b6da1cf
..
a389c10
100644
(file)
--- a/
Usermode/Applications/cat_src/main.c
+++ b/
Usermode/Applications/cat_src/main.c
@@
-7,6
+7,10
@@
#define BUF_SIZE 1024
#define BUF_SIZE 1024
+/**
+ * \fn int main(int argc, char *argv[])
+ * \brief Entrypoint
+ */
int main(int argc, char *argv[])
{
int fd;
int main(int argc, char *argv[])
{
int fd;
@@
-18,7
+22,6
@@
int main(int argc, char *argv[])
return -1;
}
return -1;
}
- printf("Contents of `%s'\n", argv[1]);
fd = open(argv[1], OPENFLAG_READ);
if(fd == -1) {
printf("Unable to open '%s' for reading\n", argv[1]);
fd = open(argv[1], OPENFLAG_READ);
if(fd == -1) {
printf("Unable to open '%s' for reading\n", argv[1]);
@@
-26,8
+29,8
@@
int main(int argc, char *argv[])
}
do {
}
do {
- num = read(fd,
BUF_SIZE, buf
);
-
//printf("num = %i\n", num)
;
+ num = read(fd,
buf, BUF_SIZE
);
+
if(num < 0) break
;
buf[num] = '\0';
printf("%s", buf);
} while(num == BUF_SIZE);
buf[num] = '\0';
printf("%s", buf);
} while(num == BUF_SIZE);
UCC
git Repository :: git.ucc.asn.au