From 53bf00c9d55895c9ff034acab4bf808c65b96d8a Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 6 Oct 2002 22:55:32 +0000 Subject: [PATCH] Fixed actual bug in set_stat(). Discovered by the gcc from GeekGadgets. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1415 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/storage/kernel_interface.POSIX.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kits/storage/kernel_interface.POSIX.cpp b/src/kits/storage/kernel_interface.POSIX.cpp index 74f399c397..fcf0cd7e40 100644 --- a/src/kits/storage/kernel_interface.POSIX.cpp +++ b/src/kits/storage/kernel_interface.POSIX.cpp @@ -450,14 +450,14 @@ BPrivate::Storage::set_stat(const char *file, Stat &s, StatMember what) { // Grab the previous mod and access times so we only overwrite // the specified time and not both - Stat *oldStat; - result = ::stat(file, oldStat); + Stat oldStat; + result = ::stat(file, &oldStat); if (result < 0) break; utimbuf buffer; - buffer.actime = (what == WSTAT_ATIME) ? s.st_atime : oldStat->st_atime; - buffer.modtime = (what == WSTAT_MTIME) ? s.st_mtime : oldStat->st_mtime; + buffer.actime = (what == WSTAT_ATIME) ? s.st_atime : oldStat.st_atime; + buffer.modtime = (what == WSTAT_MTIME) ? s.st_mtime : oldStat.st_mtime; result = ::utime(file, &buffer); }