From d49889d24686fff901392b6dd1f9c6a5214e8464 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Sun, 25 Oct 2015 14:37:11 +0100 Subject: Revert "fix struct stat64 problem for musl libc" This reverts commit 801164566924c41d18d66bdc9ca8b2305103fb82. --- src/libtrace/Makefile.in | 3 +-- src/libtrace/libtrace.c | 14 ------------- src/libtrace/musl_defs.h | 52 ------------------------------------------------ 3 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 src/libtrace/musl_defs.h (limited to 'src/libtrace') diff --git a/src/libtrace/Makefile.in b/src/libtrace/Makefile.in index 8bc57cddf..3924bdf3f 100644 --- a/src/libtrace/Makefile.in +++ b/src/libtrace/Makefile.in @@ -2,13 +2,12 @@ PREFIX=@prefix@ VERSION=@PACKAGE_VERSION@ NAME=@PACKAGE_NAME@ HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@ -HAVE_MUSL_LIBC=@HAVE_MUSL_LIBC@ H_FILE_LIST = $(wildcard *.[h]) C_FILE_LIST = $(wildcard *.c) OBJS = $(C_FILE_LIST:.c=.o) BINOBJS = $(foreach file, $(OBJS), $file) -CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_MUSL_LIBC) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security +CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now all: libtrace.so diff --git a/src/libtrace/libtrace.c b/src/libtrace/libtrace.c index 2ce74d331..1eb1cf931 100644 --- a/src/libtrace/libtrace.c +++ b/src/libtrace/libtrace.c @@ -18,11 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #define _GNU_SOURCE -#ifdef HAVE_MUSL_LIBC -#include "musl_defs.h" -#else #include -#endif #include #include #include @@ -32,9 +28,7 @@ #include #include #include -#ifndef HAVE_MUSL_LIBC #include -#endif // break recursivity on fopen call typedef FILE *(*orig_fopen_t)(const char *pathname, const char *mode); @@ -420,17 +414,9 @@ int stat(const char *pathname, struct stat *buf) { return rv; } -#ifdef HAVE_MUSL_LIBC -typedef int (*orig_stat64_t)(const char *pathname, struct stat *buf); -#else typedef int (*orig_stat64_t)(const char *pathname, struct stat64 *buf); -#endif static orig_stat64_t orig_stat64 = NULL; -#ifdef HAVE_MUSL_LIBC -int stat64(const char *pathname, struct stat *buf) { -#else int stat64(const char *pathname, struct stat64 *buf) { -#endif if (!orig_stat) orig_stat64 = (orig_stat64_t)dlsym(RTLD_NEXT, "stat"); diff --git a/src/libtrace/musl_defs.h b/src/libtrace/musl_defs.h deleted file mode 100644 index 02eb65b83..000000000 --- a/src/libtrace/musl_defs.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2014, 2015 Firejail Authors - * - * This file is part of firejail project - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#ifndef _MUSL_DEFS_H -#define _MUSL_DEFS_H - -#include - -#define __NEED_FILE -#define __NEED_dev_t -#define __NEED_ino_t -#define __NEED_mode_t -#define __NEED_nlink_t -#define __NEED_uid_t -#define __NEED_gid_t -#define __NEED_off_t -#define __NEED_time_t -#define __NEED_blksize_t -#define __NEED_blkcnt_t -#define __NEED_struct_timespec - -#include -#include - -#ifdef __cplusplus -#define NULL 0L -#else -#define NULL ((void*)0) -#endif - -int printf(const char *format, ...); -int sprintf(char *buffer, const char *format, ...); -char *fgets(char *buffer, int size, FILE *fp); - -#endif -- cgit v1.2.3-54-g00ecf