Browse Source

fl_wrapper: changed tpl_open.c and tpl_rest.c to use HAS_FFD

user/amery/test/random-cleanup
Alejandro Mery 14 years ago
committed by Alejandro Mery
parent
commit
f420f62620
3 changed files with 21 additions and 1 deletions
  1. +1
    -1
      src/tools-source/fl_wrapper/Makefile
  2. +12
    -0
      src/tools-source/fl_wrapper/tpl_open.c
  3. +8
    -0
      src/tools-source/fl_wrapper/tpl_rest.c

+ 1
- 1
src/tools-source/fl_wrapper/Makefile

@ -13,7 +13,7 @@
# --- SDE-COPYRIGHT-NOTE-END ---
CC=gcc
CFLAGS=-Wall -O2 -ldl -shared -fPIC
CFLAGS=-Wall -Wextra -O2 -ldl -shared -fPIC
ifeq ($(DEBUG),yes)
CFLAGS += -DDEBUG=1

+ 12
- 0
src/tools-source/fl_wrapper/tpl_open.c

@ -28,10 +28,18 @@ RET_TYPE FUNCTION(P1)
#ifdef FLWRAPPER_BASEDIR
if (a & (O_WRONLY|O_CREAT|O_APPEND))
# if HAS_FFD
check_writeat_access("FUNCTION", ffd, f);
# else
check_write_access("FUNCTION", f);
# endif
#endif
#if HAS_FFD
handle_fileat_access_before("FUNCTION", ffd, f, &status);
#else
handle_file_access_before("FUNCTION", f, &status);
#endif
if (!orig_FUNCTION) orig_FUNCTION = get_dl_symbol("FUNCTION");
errno=old_errno;
@ -52,7 +60,11 @@ RET_TYPE FUNCTION(P1)
rc = orig_FUNCTION(P2);
old_errno=errno;
#if HAS_FFD
handle_fileat_access_after("FUNCTION", ffd, f, &status);
#else
handle_file_access_after("FUNCTION", f, &status);
#endif
errno=old_errno;
return rc;

+ 8
- 0
src/tools-source/fl_wrapper/tpl_rest.c

@ -25,7 +25,11 @@ RET_TYPE FUNCTION(P1)
int old_errno=errno;
RET_TYPE rc;
#if HAS_FFD
handle_fileat_access_before("FUNCTION", ffd, f, &status);
#else
handle_file_access_before("FUNCTION", f, &status);
#endif
if (!orig_FUNCTION) orig_FUNCTION = get_dl_symbol("FUNCTION");
errno=old_errno;
@ -36,7 +40,11 @@ RET_TYPE FUNCTION(P1)
rc = orig_FUNCTION(P2);
old_errno=errno;
#if HAS_FFD
handle_fileat_access_after("FUNCTION", ffd, f, &status);
#else
handle_file_access_after("FUNCTION", f, &status);
#endif
errno=old_errno;
return rc;

Loading…
Cancel
Save