Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 853
    • Issues 853
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 54
    • Merge requests 54
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Merge requests
  • !2911

glocalfileinfo: In set_mtime_atime(), don't use utimensat() if it's not available

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jared Wahlstrand requested to merge jwahlstrand/glib:utimensat2 into main Sep 21, 2022
  • Overview 9
  • Commits 3
  • Pipelines 6
  • Changes 2

There are a lot of checks for HAVE_UTIMENSAT in this function, but one more is needed. This fixes the build on platforms that don't have utimensat().

[21:53:08] ../gio/glocalfileinfo.c:2803:9: error: implicit declaration of function 'utimensat' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
[21:53:08]   res = utimensat (AT_FDCWD, filename, times_n, 0);
[21:53:08]         ^
[21:53:08] ../gio/glocalfileinfo.c:2803:9: note: did you mean 'utimes'?
[21:53:08] /opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root/usr/include/sys/time.h:202:5: note: 'utimes' declared here
[21:53:08] int     utimes(const char *, const struct timeval *);
[21:53:08]         ^
[21:53:08] ../gio/glocalfileinfo.c:2803:40: error: use of undeclared identifier 'times_n'; did you mean 'times'?
[21:53:08]   res = utimensat (AT_FDCWD, filename, times_n, 0);
[21:53:08]                                        ^~~~~~~
[21:53:08]                                        times
[21:53:08] ../gio/glocalfileinfo.c:2698:18: note: 'times' declared here
[21:53:08]   struct timeval times[2] = { {0, 0}, {0, 0} };
[21:53:08]                  ^
[21:53:08] 2 errors generated.
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: utimensat2