termux-packages/packages/apt/private-install-no-statvfs.patch

34 lines
1.3 KiB
Diff
Raw Normal View History

2015-06-13 01:03:31 +02:00
diff -u -r ../upstream.git/apt-private/private-install.cc ./apt-private/private-install.cc
--- ../upstream.git/apt-private/private-install.cc 2014-03-14 09:05:18.000000000 +0100
+++ ./apt-private/private-install.cc 2014-04-15 20:58:34.416703941 +0200
@@ -24,7 +24,9 @@
#include <stdlib.h>
#include <string.h>
#include <sys/statfs.h>
-#include <sys/statvfs.h>
+#ifndef __ANDROID__
+# include <sys/statvfs.h>
+#endif
#include <algorithm>
#include <iostream>
#include <set>
@@ -179,14 +181,14 @@
if (_config->FindB("APT::Get::Print-URIs") == false &&
_config->FindB("APT::Get::Download",true) == true)
{
- struct statvfs Buf;
+ struct statfs Buf;
std::string OutputDir = _config->FindDir("Dir::Cache::Archives");
- if (statvfs(OutputDir.c_str(),&Buf) != 0) {
+ if (statfs(OutputDir.c_str(),&Buf) != 0) {
if (errno == EOVERFLOW)
- return _error->WarningE("statvfs",_("Couldn't determine free space in %s"),
+ return _error->WarningE("statfs",_("Couldn't determine free space in %s"),
OutputDir.c_str());
else
- return _error->Errno("statvfs",_("Couldn't determine free space in %s"),
+ return _error->Errno("statfs",_("Couldn't determine free space in %s"),
OutputDir.c_str());
} else if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize)
{