Skip to content

Commit

Permalink
fix(userspace/libscap): fix build without USE_ZLIB macro.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
  • Loading branch information
FedeDP authored and poiana committed Oct 7, 2024
1 parent 85713d3 commit 37d4383
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions userspace/libscap/scap_zlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ limitations under the License.
#include <zlib.h>
#else
#include <stdio.h>

#define Z_OK 0
#define Z_BUF_ERROR 1

#define gzFile FILE*
#define gzflush(X, Y) fflush(X)
#define gzopen fopen
Expand All @@ -36,9 +40,11 @@ limitations under the License.
#define gzwrite(F, B, S) fwrite(B, 1, S, F)
#define gzread(F, B, S) fread(B, 1, S, F)
#define gztell(F) ftell(F)
#define gzclearerr(F) clearerr(F)
inline static const char *gzerror(FILE *F, int *E) {
*E = ferror(F);
return "error reading file descriptor";
}

#define gzseek fseek
#endif

0 comments on commit 37d4383

Please sign in to comment.