More work on the interface to add/remove file analysis actions.

Added the file extraction action and did other misc. cleanup.  Most of
the minimal core features/support for file analysis should be working at
this point, just have to start fleshing things out.
This commit is contained in:
Jon Siwek 2013-02-14 12:53:20 -06:00
parent b9d204005d
commit f04d189d3f
8 changed files with 398 additions and 74 deletions

View file

@ -1391,6 +1391,31 @@ bool safe_write(int fd, const char* data, int len)
return true;
}
bool safe_pwrite(int fd, const unsigned char* data, size_t len, size_t offset)
{
while ( len != 0 )
{
ssize_t n = pwrite(fd, data, len, offset);
if ( n < 0 )
{
if ( errno == EINTR )
continue;
fprintf(stderr, "safe_write error: %d\n", errno);
abort();
return false;
}
data += n;
offset +=n;
len -= n;
}
return true;
}
void safe_close(int fd)
{
/*