summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/sat-solver/sat-solver/futimes.patch
blob: b24d852ae74eeb6c28956892e36641e3d69cd1cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
This patch uses utimes instead of futimes for uclibc
since futimes is not available

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>

Index: git/examples/solv.c
===================================================================
--- git.orig/examples/solv.c	2012-06-01 12:06:22.041552848 -0700
+++ git/examples/solv.c	2012-06-01 12:49:17.417677449 -0700
@@ -1027,7 +1027,8 @@
   int flags;
 
   cinfo = repo->appdata;
-  if (!(fp = fopen(calccachepath(repo, repoext), "r")))
+  const char* fname = calccachepath(repo, repoext);
+  if (!(fp = fopen(fname, "r")))
     return 0;
   if (fseek(fp, -sizeof(mycookie), SEEK_END) || fread(mycookie, sizeof(mycookie), 1, fp) != 1)
     {
@@ -1068,7 +1069,11 @@
       memcpy(cinfo->extcookie, myextcookie, sizeof(myextcookie));
     }
   if (mark)
+#ifdef __UCLIBC__
+    utimes(fname, 0);	/* try to set modification time */
+#else
     futimes(fileno(fp), 0);	/* try to set modification time */
+#endif
   fclose(fp);
   return 1;
 }