]> andersk Git - openssh.git/blobdiff - openbsd-compat/bsd-misc.c
[scp.c] make compilers without long long happy.
[openssh.git] / openbsd-compat / bsd-misc.c
index d87d56218c8a856c39e185f3ca62b0295b45a604..f27788729bf2a6364aacee37db5dfb441acc674c 100644 (file)
@@ -93,9 +93,39 @@ int utimes(char *filename, struct timeval *tvp)
 {
        struct utimbuf ub;
 
-       ub.actime = tvp->tv_sec;
-       ub.modtime = tvp->tv_usec;
+       ub.actime = tvp[0].tv_sec;
+       ub.modtime = tvp[1].tv_sec;
        
        return(utime(filename, &ub));
 }
 #endif 
+
+#ifndef HAVE_TRUNCATE
+int truncate (const char *path, off_t length)
+{
+       int fd, ret, saverrno;
+
+       fd = open(path, O_WRONLY);
+       if (fd < 0)
+               return -1;
+
+       ret = ftruncate(fd, length);
+       saverrno = errno;
+       (void) close (fd);
+       if (ret == -1)
+               errno = saverrno;
+       return(ret);
+}
+#endif /* HAVE_TRUNCATE */
+
+#if !defined(HAVE_SETGROUPS) && defined(SETGROUPS_NOOP)
+/*
+ * Cygwin setgroups should be a noop.
+ */
+int
+setgroups(size_t size, const gid_t *list)
+{
+       return 0;
+}
+#endif 
+
This page took 0.096375 seconds and 4 git commands to generate.