mirror of
https://github.com/samba-team/samba.git
synced 2025-03-01 04:58:35 +03:00
r21715: Fix torture utime code.
Jeremy. (This used to be commit 10430bf75accc71045ed359314dc2711fea8df01)
This commit is contained in:
parent
4952fe368a
commit
f41de9314b
@ -783,14 +783,14 @@ static NTSTATUS cmd_getwd(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
|
|||||||
|
|
||||||
static NTSTATUS cmd_utime(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
|
static NTSTATUS cmd_utime(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
|
||||||
{
|
{
|
||||||
struct utimbuf times;
|
struct timespec ts[2];
|
||||||
if (argc != 4) {
|
if (argc != 4) {
|
||||||
printf("Usage: utime <path> <access> <modify>\n");
|
printf("Usage: utime <path> <access> <modify>\n");
|
||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
times.actime = atoi(argv[2]);
|
ts[0] = convert_time_t_to_timespec(atoi(argv[2]));
|
||||||
times.modtime = atoi(argv[3]);
|
ts[1] = convert_time_t_to_timespec(atoi(argv[3]));
|
||||||
if (SMB_VFS_UTIME(vfs->conn, argv[1], ×) != 0) {
|
if (SMB_VFS_NTIMES(vfs->conn, argv[1], ts) != 0) {
|
||||||
printf("utime: error=%d (%s)\n", errno, strerror(errno));
|
printf("utime: error=%d (%s)\n", errno, strerror(errno));
|
||||||
return NT_STATUS_UNSUCCESSFUL;
|
return NT_STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user