コード例 #1
0
int smbd_gpfs_set_times_path(char *path, struct smb_file_time *ft)
{
	gpfs_timestruc_t gpfs_times[4];
	int flags = 0;
	int rc;

	if (!gpfs_set_times_path_fn) {
		errno = ENOSYS;
		return -1;
	}

	ZERO_ARRAY(gpfs_times);
	timespec_to_gpfs_time(ft->atime, gpfs_times, 0, &flags);
	timespec_to_gpfs_time(ft->mtime, gpfs_times, 1, &flags);
	/* No good mapping from LastChangeTime to ctime, not storing */
	timespec_to_gpfs_time(ft->create_time, gpfs_times, 3, &flags);

	if (!flags) {
		DEBUG(10, ("nothing to do, return to avoid EINVAL\n"));
		return 0;
	}

	rc = gpfs_set_times_path_fn(path, flags, gpfs_times);

	if (rc != 0) {
		DEBUG(1,("gpfs_set_times() returned with error %s\n",
			strerror(errno)));
	}

	return rc;
}
コード例 #2
0
ファイル: gpfswrap.c プロジェクト: Alexander--/samba
int gpfswrap_set_times_path(char *pathname, int flags,
			    gpfs_timestruc_t times[4])
{
	if (gpfs_set_times_path_fn == NULL) {
		errno = ENOSYS;
		return -1;
	}

	return gpfs_set_times_path_fn(pathname, flags, times);
}