From 1d553ec31a425c00aac1f7c7d0fb74d7f6e4e456 Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Tue, 27 Dec 2016 09:19:26 -0800 Subject: [PATCH] fix scap_fds.c compile and link (#705) * 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 * 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 --- userspace/libscap/scap-int.h | 2 +- userspace/libscap/scap_fds.c | 2 ++ userspace/libscap/scap_savefile.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/userspace/libscap/scap-int.h b/userspace/libscap/scap-int.h index 86d58cdd21..b92217b098 100644 --- a/userspace/libscap/scap-int.h +++ b/userspace/libscap/scap-int.h @@ -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 diff --git a/userspace/libscap/scap_fds.c b/userspace/libscap/scap_fds.c index debb0dc23b..27760c741f 100644 --- a/userspace/libscap/scap_fds.c +++ b/userspace/libscap/scap_fds.c @@ -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 // diff --git a/userspace/libscap/scap_savefile.c b/userspace/libscap/scap_savefile.c index e5bb7c26ae..0cb20c0f6c 100755 --- a/userspace/libscap/scap_savefile.c +++ b/userspace/libscap/scap_savefile.c @@ -36,7 +36,7 @@ along with sysdig. If not, see . // // 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) {