diff --git a/src/bin/unzip/beos.c b/src/bin/unzip/beos.c index 28c66eb7a9..94e9f4551a 100644 --- a/src/bin/unzip/beos.c +++ b/src/bin/unzip/beos.c @@ -1107,10 +1107,16 @@ static int set_file_attrs( const char *name, ptr = (unsigned char *)attr_buff; guard = ptr + attr_size; +#ifdef HAIKU_USE_KERN_OPEN + fd = _kern_open( -1, name, O_RDONLY | O_NOTRAVERSE, 0 ); + if( fd < 0 ) + return fd; +#else fd = open( name, O_RDONLY | O_NOTRAVERSE ); if( fd < 0 ) { return errno; /* should it be -fd ? */ } +#endif while( ptr < guard ) { ssize_t wrote_bytes; diff --git a/src/tools/unzip/unix/unxcfg.h b/src/tools/unzip/unix/unxcfg.h index 6c231d41c3..33047c20d7 100644 --- a/src/tools/unzip/unix/unxcfg.h +++ b/src/tools/unzip/unix/unxcfg.h @@ -28,4 +28,8 @@ # ifndef EOK # define EOK B_OK # endif -#endif // __BEOS__ + +# define HAIKU_USE_KERN_OPEN 1 +extern int _kern_open(int fd, const char *path, int openMode, int perms); + +#endif // !__BEOS__