Fixed compiling on NetBSD 3.1
This commit is contained in:
@@ -1053,7 +1053,11 @@ int file_transfer(void)
|
||||
|
||||
TrType binkp_receiver(void)
|
||||
{
|
||||
#ifdef __NetBSD__
|
||||
struct statvfs sfs;
|
||||
#else
|
||||
struct statfs sfs;
|
||||
#endif
|
||||
int written;
|
||||
off_t rxbytes;
|
||||
int bcmd, rc = 0;
|
||||
@@ -1208,7 +1212,11 @@ TrType binkp_receiver(void)
|
||||
return Failure;
|
||||
}
|
||||
|
||||
#ifdef __NetBSD__
|
||||
if (statvfs(tempinbound, &sfs) == 0) {
|
||||
#else
|
||||
if (statfs(tempinbound, &sfs) == 0) {
|
||||
#endif
|
||||
if ((bp.rsize / (sfs.f_bsize + 1)) >= sfs.f_bfree) {
|
||||
Syslog('!', "Binkp: only %u blocks free (need %u) in %s for this file", sfs.f_bfree,
|
||||
(unsigned int)(bp.rsize / (sfs.f_bsize + 1)), tempinbound);
|
||||
|
@@ -198,9 +198,15 @@ int inbound_close(int success)
|
||||
*/
|
||||
int inbound_space(void)
|
||||
{
|
||||
#ifdef __NetBSD__
|
||||
struct statvfs sfs;
|
||||
|
||||
if (statvfs(tempinbound, &sfs) != 0) {
|
||||
#else
|
||||
struct statfs sfs;
|
||||
|
||||
if (statfs(tempinbound, &sfs) != 0) {
|
||||
#endif
|
||||
Syslog('!', "Cannot statfs \"%s\", assume enough space", tempinbound);
|
||||
return -1L;
|
||||
} else
|
||||
|
@@ -558,6 +558,15 @@ int putsec(char *buf, int n)
|
||||
|
||||
int getfree(void)
|
||||
{
|
||||
#ifdef __NetBSD__
|
||||
struct statvfs sfs;
|
||||
|
||||
if (statvfs(inbound, &sfs) != 0) {
|
||||
WriteError("$cannot statvfs \"%s\", assume enough space", inbound);
|
||||
return -1L;
|
||||
} else
|
||||
return (sfs.f_bsize * sfs.f_bfree);
|
||||
#else
|
||||
struct statfs sfs;
|
||||
|
||||
if (statfs(inbound, &sfs) != 0) {
|
||||
@@ -565,6 +574,7 @@ int getfree(void)
|
||||
return -1L;
|
||||
} else
|
||||
return (sfs.f_bsize * sfs.f_bfree);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user