Re: [PATCH 2/2] better introduction of GIT with USE_NSEC defined

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Sixt schrieb:
> Kjetil Barvik schrieb:
>> -	istate->timestamp.sec = st.st_mtime;
>> -#ifdef USE_NSEC
>> +	istate->timestamp.sec = (unsigned int)st.st_mtime;
>>  	istate->timestamp.nsec = (unsigned int)st.st_mtim.tv_nsec;
>> -#else
>> -	istate->timestamp.nsec = 0;
>> -#endif
> 
> Doesn't this break on systems where st_mtime is time_t and st_mtim does
> not exist?

Yes, it breaks. You can test this on Linux by commenting out these two
lines in git-compat-util.h:

diff --git a/git-compat-util.h b/git-compat-util.h
index dcf4127..ab4b615 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -44,8 +44,8 @@
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
 #define _ALL_SOURCE 1
-#define _GNU_SOURCE 1
-#define _BSD_SOURCE 1
+/*#define _GNU_SOURCE 1*/
+/*#define _BSD_SOURCE 1*/

 #include <unistd.h>
 #include <stdio.h>

The result even passes the test suite (as long as I don't merge
kb/checkout-optim, of course).

-- Hannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux