]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
libcephfs: include <sys/time.h> 41391/head
authorKefu Chai <kchai@redhat.com>
Wed, 19 May 2021 01:18:33 +0000 (09:18 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 19 May 2021 01:21:19 +0000 (09:21 +0800)
header files should be self-contained. we are using `timeval` in the header,
but failed to include the header defining it.

this change addresses the build failures on Darwin like:

int ceph_lutimes(struct ceph_mount_info *cmount, const char *path, struct timeval times[2]);
                                                                          ^
src/include/cephfs/libcephfs.h:1080:78: error: array has incomplete element type 'struct timeval'
int ceph_futimes(struct ceph_mount_info *cmount, int fd, struct timeval times[2]);
                                                                             ^
src/include/cephfs/libcephfs.h:1080:65: note: forward declaration of 'struct timeval'
int ceph_futimes(struct ceph_mount_info *cmount, int fd, struct timeval times[2]);
                                                                ^
3 errors generated.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/include/cephfs/libcephfs.h

index 4e477712afc3ea6112cc83c8864fe51775c069dd..876ba2b0aea4bc1b4ad033afb41d26b8494c37ea 100644 (file)
@@ -20,6 +20,7 @@
 #endif
 #include <utime.h>
 #include <sys/stat.h>
+#include <sys/time.h>
 #include <sys/types.h>
 #include <sys/statvfs.h>
 #include <sys/socket.h>