]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
debugfs, tune2fs: Handle daylight savings time when parsing a time string
authorTheodore Ts'o <tytso@mit.edu>
Fri, 21 Mar 2008 13:10:09 +0000 (09:10 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 21 Mar 2008 13:10:09 +0000 (09:10 -0400)
We need to set tm_isdst to -1 so that mktime will automatically
determine whether or not daylight savings time (DST) is in effect.
Previously tm_isdst was set to 0, which caused mktime to interpret the
time as if it was always not using DST.

Addresses-Debian-Bug: #471882

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
debugfs/util.c
misc/tune2fs.c

index 06339601e694e97c7fb567c0ca728ee8b97fc6a7..ebce9d6109ab6510b84cdd306080fbb0b476895c 100644 (file)
@@ -231,6 +231,7 @@ extern time_t string_to_time(const char *arg)
            ts.tm_min > 59 || ts.tm_sec > 61)
                ts.tm_mday = 0;
 #endif
+       ts.tm_isdst = -1;
        ret = mktime(&ts);
        if (ts.tm_mday == 0 || ret == ((time_t) -1)) {
                /* Try it as an integer... */
index 4f66d42b0229116ba4f0398bed48882c0e1921bf..4e731f5cc221d99f554f91283d8749324230f9c3 100644 (file)
@@ -540,6 +540,7 @@ static time_t parse_time(char *str)
                        str);
                usage();
        }
+       ts.tm_isdst = -1;
        return (mktime(&ts));
 }