Return to file.c CVS log | Up to [local] / src / usr.bin / file |
version 1.58, 2016/05/01 20:34:26 | version 1.59, 2017/04/18 14:16:48 | ||
---|---|---|---|
|
|
||
#include "magic.h" | #include "magic.h" | ||
#include "xmalloc.h" | #include "xmalloc.h" | ||
struct input_msg | struct input_msg { | ||
{ | |||
int idx; | int idx; | ||
struct stat sb; | struct stat sb; | ||
|
|
||
int link_target; | int link_target; | ||
}; | }; | ||
struct input_ack | struct input_ack { | ||
{ | |||
int idx; | int idx; | ||
}; | }; | ||
struct input_file | struct input_file { | ||
{ | |||
struct magic *m; | struct magic *m; | ||
struct input_msg *msg; | struct input_msg *msg; | ||
|
|
||
if (got == -1) { | if (got == -1) { | ||
if (errno == EINTR) | if (errno == EINTR) | ||
continue; | continue; | ||
return NULL; | return (NULL); | ||
} | } | ||
if (got == 0) | if (got == 0) | ||
break; | break; | ||
|
|
||
left -= got; | left -= got; | ||
} | } | ||
*used = size - left; | *used = size - left; | ||
return buffer; | return (buffer); | ||
} | } | ||
static int | static int |