1/*- 2 * Copyright (c) 2003-2008 Tim Kientzle 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25#include "test.h" 26#if defined(HAVE_UTIME_H) 27#include <utime.h> 28#elif defined(HAVE_SYS_UTIME_H) 29#include <sys/utime.h> 30#endif |
31__FBSDID("$FreeBSD: stable/11/contrib/libarchive/cpio/test/test_option_a.c 318482 2017-05-18 19:47:43Z mm $"); |
32 33static struct { 34 const char *name; 35 time_t atime_sec; 36} files[] = { 37 { "f0", 0 }, 38 { "f1", 0 }, 39 { "f2", 0 }, --- 51 unchanged lines hidden (view full) --- 91 struct stat st; 92 int r; 93 char *p; 94 95 /* Create all of the test files. */ 96 test_create(); 97 98 /* Sanity check; verify that atimes really do get modified. */ |
99 p = slurpfile(NULL, "f0"); 100 assert(p != NULL); |
101 free(p); 102 assertEqualInt(0, stat("f0", &st)); 103 if (st.st_atime == files[0].atime_sec) { 104 skipping("Cannot verify -a option\n" 105 " Your system appears to not support atime."); 106 } 107 else 108 { --- 47 unchanged lines hidden --- |