mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix utime(3) not handling times being NULL.
This commit is contained in:
parent
0e119b8480
commit
050ba71ca0
1 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013 Jonas 'Sortie' Termansen.
|
||||
* Copyright (c) 2013, 2022 Jonas 'Sortie' Termansen.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -29,6 +29,8 @@
|
|||
// nice to remove this at some point.
|
||||
int utime(const char* filepath, const struct utimbuf* times)
|
||||
{
|
||||
if ( !times )
|
||||
return utimens(filepath, NULL);
|
||||
struct timespec ts_times[2];
|
||||
ts_times[0] = timespec_make(times->actime, 0);
|
||||
ts_times[1] = timespec_make(times->modtime, 0);
|
||||
|
|
Loading…
Reference in a new issue