Skip to content

Commit

Permalink
fix scap_fds.c compile and link (draios#705)
Browse files Browse the repository at this point in the history
* scap-int.h: fix forward declaration of scap_fd_write_to_disk

Now uses scap_dumper_t* instead of gzFile as last argument.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>

* scap_fds: fix references to scap_dump_write

There wasn't a forward declaration of scap_dump_write, and the
definition of scap_dump_write was declared with inline linkage, which
would break when trying to link scap_fds.o's references to
scap_dump_write.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
  • Loading branch information
tycho authored and Damian Myerscough committed Mar 3, 2017
1 parent c52eae9 commit 1d553ec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion userspace/libscap/scap-int.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ int32_t scap_fd_info_to_string(scap_fdinfo* fdi, OUT char* str, uint32_t strlen)
// Calculate the length on disk of an fd entry's info
uint32_t scap_fd_info_len(scap_fdinfo* fdi);
// Write the given fd info to disk
int32_t scap_fd_write_to_disk(scap_t* handle, scap_fdinfo* fdi, gzFile f);
int32_t scap_fd_write_to_disk(scap_t* handle, scap_fdinfo* fdi, scap_dumper_t* dumper);
// Populate the given fd by reading the info from disk
uint32_t scap_fd_read_from_disk(scap_t* handle, OUT scap_fdinfo* fdi, OUT size_t* nbytes, gzFile f);
// Parse the headers of a trace file and load the tables
Expand Down
2 changes: 2 additions & 0 deletions userspace/libscap/scap_fds.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ uint32_t scap_fd_info_len(scap_fdinfo *fdi)
return res;
}

int scap_dump_write(scap_dumper_t *d, void* buf, unsigned len);

//
// Write the given fd info to disk
//
Expand Down
2 changes: 1 addition & 1 deletion userspace/libscap/scap_savefile.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ along with sysdig. If not, see <http://www.gnu.org/licenses/>.
//
// Write data into a dump file
//
inline int scap_dump_write(scap_dumper_t *d, void* buf, unsigned len)
int scap_dump_write(scap_dumper_t *d, void* buf, unsigned len)
{
if(d->m_type == DT_FILE)
{
Expand Down

0 comments on commit 1d553ec

Please sign in to comment.