2015-08-26 00:25:24 +02:00
|
|
|
diff -u -r ../dpkg-1.18.2/lib/dpkg/atomic-file.c ./lib/dpkg/atomic-file.c
|
|
|
|
--- ../dpkg-1.18.2/lib/dpkg/atomic-file.c 2015-07-12 22:38:47.000000000 -0400
|
|
|
|
+++ ./lib/dpkg/atomic-file.c 2015-08-25 18:06:51.689715379 -0400
|
2016-03-16 15:53:16 +01:00
|
|
|
@@ -90,8 +90,14 @@
|
2015-07-10 03:04:45 +02:00
|
|
|
|
|
|
|
if (unlink(name_old) && errno != ENOENT)
|
|
|
|
ohshite(_("error removing old backup file '%s'"), name_old);
|
|
|
|
- if (link(file->name, name_old) && errno != ENOENT)
|
|
|
|
- ohshite(_("error creating new backup file '%s'"), name_old);
|
2016-03-16 15:53:16 +01:00
|
|
|
+#ifdef __ANDROID__
|
|
|
|
+ /* Termux: Use rename(2) since Android does not support hardlinks. */
|
|
|
|
+ if (rename(file->name, name_old) && errno != ENOENT) {
|
|
|
|
+#else
|
2015-07-10 03:04:45 +02:00
|
|
|
+ if (link(file->name, name_old) && errno != ENOENT) {
|
2016-03-16 15:53:16 +01:00
|
|
|
+#endif
|
|
|
|
+ ohshite(_("error creating new backup file '%s'"), name_old);
|
2015-07-10 03:04:45 +02:00
|
|
|
+ }
|
|
|
|
|
|
|
|
free(name_old);
|
|
|
|
}
|