-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: directly pass libfaketime CFLAGS
instead of changing the Makefile C flags in the patch
- Loading branch information
Showing
4 changed files
with
41 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
diff --git a/src/libfaketime.c b/src/libfaketime.c | ||
index e632395..09d9019 100644 | ||
--- a/src/libfaketime.c | ||
+++ b/src/libfaketime.c | ||
@@ -2384,10 +2384,16 @@ static void parse_ft_string(const char *user_faked_time) | ||
user_faked_time_tm.tm_isdst = -1; | ||
nstime_str = strptime(user_faked_time, user_faked_time_fmt, &user_faked_time_tm); | ||
|
||
+ /* the actual format has a " %f" appended. Parse out the microseconds. */ | ||
+ char nanosecond_str[7]; | ||
+ memcpy(&nanosecond_str, user_faked_time + 20, 6); | ||
+ nanosecond_str[6] = '\0'; | ||
+ int nanoseconds = atoi(nanosecond_str) * 1000; | ||
+ | ||
if (NULL != nstime_str) | ||
{ | ||
user_faked_time_timespec.tv_sec = mktime(&user_faked_time_tm); | ||
- user_faked_time_timespec.tv_nsec = 0; | ||
+ user_faked_time_timespec.tv_nsec = nanoseconds; | ||
|
||
if (nstime_str[0] == '.') | ||
{ | ||
-- | ||
2.45.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters