diff options
Diffstat (limited to 'bindings/solv.i')
-rw-r--r-- | bindings/solv.i | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bindings/solv.i b/bindings/solv.i index ad265a5..107192f 100644 --- a/bindings/solv.i +++ b/bindings/solv.i @@ -629,8 +629,10 @@ SWIG_AsValDepId(void *obj, int *val) { %typemap(out) disown_helper { #if defined(SWIGRUBY) SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, SWIG_POINTER_DISOWN | 0 ); -#elif defined(SWIGPYTHON) +#elif defined(SWIGPYTHON) && SWIG_VERSION < 0x040000 SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Pool, SWIG_POINTER_DISOWN | 0 ); +#elif defined(SWIGPYTHON) + SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Pool, SWIG_POINTER_DISOWN | 0 ); #elif defined(SWIGPERL) SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Pool, SWIG_POINTER_DISOWN | 0 ); #elif defined(SWIGTCL) @@ -1121,7 +1123,7 @@ SolvFp *solvfp_xfopen_fd(const char *fn, int fd, const char *mode = 0); fd = dup(fd); if (fd == -1) return 0; - fcntl(fd, F_SETFD, FD_CLOEXEC); + solv_setcloexec(fd, 1); fp = solv_xfopen_fd(fn, fd, mode); if (!fp) { close(fd); @@ -1138,7 +1140,7 @@ SolvFp *solvfp_xfopen_fd(const char *fn, int fd, const char *mode = 0); if (!fp) return 0; if (fileno(fp) != -1) - fcntl(fileno(fp), F_SETFD, FD_CLOEXEC); + solv_setcloexec(fileno(fp), 1); sfp = solv_calloc(1, sizeof(SolvFp)); sfp->fp = fp; return sfp; @@ -1220,7 +1222,7 @@ typedef struct { void cloexec(bool state) { if (!$self->fp || fileno($self->fp) == -1) return; - fcntl(fileno($self->fp), F_SETFD, state ? FD_CLOEXEC : 0); + solv_setcloexec(fileno($self->fp), state); } } |