From 8583de1b5524bbdb83053adf5d06781c82624db3 Mon Sep 17 00:00:00 2001 From: leitner Date: Tue, 24 Jun 2008 14:19:17 +0000 Subject: [PATCH] fix man page for openreadclose --- open/openreadclose.3 | 5 +++-- t.c | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/open/openreadclose.3 b/open/openreadclose.3 index 600410b..26993c1 100644 --- a/open/openreadclose.3 +++ b/open/openreadclose.3 @@ -10,7 +10,8 @@ int \fBopenreadclose\fP(const char *\fIfilename\fR, openreadclose opens the file \fIfilename\fR for reading and reads the whole content into the stralloc \fIsa\fR. The file is read in chunks of \fIbufsize\fR bytes size. If everything worked fine, openreadclose -returns 0. A not existing file is treated as an empty file. On error, -openreadclose returns -1 and sets errno appropriately. +returns 1. If the file did not exist, openreadclose returns 0. On +every other error, openreadclose returns -1 and sets errno +appropriately. .SH "SEE ALSO" open_read(3), readclose(3) diff --git a/t.c b/t.c index 7930128..037a49c 100644 --- a/t.c +++ b/t.c @@ -41,8 +41,13 @@ int64 writecb(int64 fd,const void* buf,uint64 n) { } int main(int argc,char* argv[]) { + char* c=fmt_strm_alloca("foo"," bar","\n"); + + write(1,c,strlen(c)); + (void)argc; (void)argv; + #if 0 io_batch* b=iob_new(1234); int64 fd=open("t.c",0); @@ -350,8 +355,10 @@ int main(int argc,char* argv[]) { assert(imult64(0x3fffffffffffffffll,2,&c)==1 && c==0x7ffffffffffffffell); } #endif +#if 0 stralloc a; printf("%d\n",stralloc_copym(&a,"fnord",", ","foo")); +#endif return 0; }