$NetBSD: patch-ab,v 1.2 2007/02/21 00:04:30 pooka Exp $ --- archivemount.c.orig 2006-12-28 17:32:47.000000000 +0200 +++ archivemount.c 2007-02-21 02:02:55.000000000 +0200 @@ -31,7 +31,11 @@ #include #include #include +#ifdef HAVE_STATVFS +#include +#else #include +#endif #include #include #include @@ -1449,11 +1453,24 @@ return tmp; } /* create temp file */ - if( mknod( location, mode, rdev ) == -1 ) { - log( "Could not create temporary file %s: %s", - location, strerror( errno ) ); - free( location ); - return 0 - errno; + if( S_ISREG(mode) ) { + int fd; + + if( fd = ( open( location, O_WRONLY | O_CREAT | O_EXCL, + mode) == -1 ) ) { + log( "Could not create temporary file %s: %s", + location, strerror( errno ) ); + free( location ); + return 0 - errno; + } + close( fd ); + } else { + if( mknod( location, mode, rdev ) == -1 ) { + log( "Could not create temporary file %s: %s", + location, strerror( errno ) ); + free( location ); + return 0 - errno; + } } /* build node */ node = ( NODE * )malloc( sizeof( NODE ) ); @@ -1605,7 +1622,11 @@ } static int +#ifdef HAVE_STATVFS +ar_statfs( const char *path, struct statvfs *stbuf ) +#else ar_statfs( const char *path, struct statfs *stbuf ) +#endif { /* ENOSYS is ok for this, we have no statistics */ ( void )path;