Changeset 134 for branches/samba-3.0/source/lib/xfile.c
- Timestamp:
- May 23, 2008, 6:56:41 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/source/lib/xfile.c
r1 r134 49 49 int x_setvbuf(XFILE *f, char *buf, int mode, size_t size) 50 50 { 51 x_fflush(f);51 if (x_fflush(f) != 0) return -1; 52 52 if (f->bufused) return -1; 53 53 … … 152 152 153 153 /* make sure we flush any buffered data */ 154 x_fflush(f);154 (void)x_fflush(f); 155 155 156 156 ret = close(f->fd); … … 191 191 if (n == 0) { 192 192 /* it's full, flush it */ 193 x_fflush(f); 193 if (x_fflush(f) != 0) { 194 return -1; 195 } 194 196 continue; 195 197 } … … 206 208 for (i=(size*nmemb)-1; i>=0; i--) { 207 209 if (*(i+(const char *)p) == '\n') { 208 x_fflush(f); 210 if (x_fflush(f) != 0) { 211 return -1; 212 } 209 213 break; 210 214 } … … 255 259 if (f->flags & X_FLAG_ERROR) return -1; 256 260 261 if (f->bufused == 0 || !f->buf) return 0; 262 257 263 if ((f->open_flags & O_ACCMODE) != O_WRONLY) { 258 264 errno = EINVAL; 259 265 return -1; 260 266 } 261 262 if (f->bufused == 0 || !f->buf) return 0;263 267 264 268 ret = write(f->fd, f->buf, f->bufused);
Note:
See TracChangeset
for help on using the changeset viewer.