mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
Trim EOL white spaces.
This commit is contained in:
parent
022c9a28ee
commit
d4c8cbf109
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=134151
@ -45,10 +45,10 @@ filedup(const char *path, int flags)
|
||||
char *buf;
|
||||
int fd;
|
||||
size_t size, result;
|
||||
|
||||
|
||||
if ((fd = open(path, F_READ | flags)) == -1)
|
||||
return(NULL);
|
||||
|
||||
|
||||
printf("%s open, flags 0x%x\n", path, files[fd].f_flags);
|
||||
buf = alloc(LOAD_TINYBUF);
|
||||
|
||||
@ -68,8 +68,7 @@ filedup(const char *path, int flags)
|
||||
|
||||
printf("tinybuf loaded, size %d\n", size);
|
||||
getchar();
|
||||
|
||||
|
||||
|
||||
/* Read everything until we know how big it is */
|
||||
for (;;) {
|
||||
result = read(fd, buf, LOAD_TINYBUF);
|
||||
@ -82,7 +81,7 @@ filedup(const char *path, int flags)
|
||||
break;
|
||||
size += result;
|
||||
}
|
||||
|
||||
|
||||
/* discard the old buffer, close the file */
|
||||
free(buf, LOAD_TINYBUF);
|
||||
close(fd);
|
||||
|
Loading…
Reference in New Issue
Block a user