Mercurial > hg > toybox
comparison lib/xwrap.c @ 1170:8afe1fde9314 draft
Pass through all the readfile() arguments from xreadfile().
author | Rob Landley <rob@landley.net> |
---|---|
date | Fri, 27 Dec 2013 18:45:01 -0600 |
parents | faf7117c4489 |
children | 0752b2d58909 |
comparison
equal
deleted
inserted
replaced
1169:ab7f336bfe52 | 1170:8afe1fde9314 |
---|---|
449 return buf; | 449 return buf; |
450 } | 450 } |
451 } | 451 } |
452 } | 452 } |
453 | 453 |
454 char *xreadfile(char *name) | 454 char *xreadfile(char *name, char *buf, off_t len) |
455 { | 455 { |
456 char *buf = readfile(name, 0, 0); | 456 if (!(buf = readfile(name, buf, len))) perror_exit("Bad '%s'", name); |
457 if (!buf) perror_exit("xreadfile %s", name); | 457 |
458 return buf; | 458 return buf; |
459 } | 459 } |
460 | 460 |
461 int xioctl(int fd, int request, void *data) | 461 int xioctl(int fd, int request, void *data) |
462 { | 462 { |