Re: [PATCH 11/17] last: parse easy to use time formats

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 27, 2013 at 07:06:13PM +0100, Sami Kerola wrote:
>  		case 'p':
>  			present = parsetm(optarg);
> -			if (present == (time_t) -1)
> +			if (present != (time_t) -1)
> +				break;
> +			if (parse_timestamp(optarg, &p) < 0)
>  				errx(EXIT_FAILURE, _("invalid time value \"%s\""), optarg);
> +			present = (time_t) (p / 1000000);
>  			break;

 It would be better to add support for YYYYMMDDHHMMSS into
 parse_timestamp() rather than maintain and use two parsers.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux