Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70467735 authored by Greg Hackmann's avatar Greg Hackmann Committed by Colin Cross
Browse files

adb: replace utimes() with utime()

Fix the win_sdk host build by replacing utimes() with utime().  utime()
is functionally equivalent to utimes() when dealing with non-fractional
second timestamps, and is supported by the Windows CRT.

(The Windows CRT uses the nonstandard name _utime(), but mingw creates
aliases to the POSIX names.)

Change-Id: I513c6c5de05376c34cbb0894a94259acba8ae6f1
parent 143b9e3d
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@
#include <limits.h>
#include <limits.h>
#include <sys/types.h>
#include <sys/types.h>
#include <zipfile/zipfile.h>
#include <zipfile/zipfile.h>
#include <utime.h>


#include "sysdeps.h"
#include "sysdeps.h"
#include "adb.h"
#include "adb.h"
@@ -935,8 +936,8 @@ static int remote_build_list(int syncfd, copyinfo **filelist,


static int set_time_and_mode(const char *lpath, unsigned int time, unsigned int mode)
static int set_time_and_mode(const char *lpath, unsigned int time, unsigned int mode)
{
{
    struct timeval times[2] = { {time, 0}, {time, 0} };
    struct utimbuf times = { time, time };
    int r1 = utimes(lpath, times);
    int r1 = utime(lpath, &times);


    /* use umask for permissions */
    /* use umask for permissions */
    mode_t mask=umask(0000);
    mode_t mask=umask(0000);