[RFC v3 4/5] commands: add hwclock
Sascha Hauer
s.hauer at pengutronix.de
Fri Jul 25 00:39:45 PDT 2014
On Fri, Jul 18, 2014 at 07:44:13AM +0200, Sascha Hauer wrote:
> On Tue, Jul 15, 2014 at 12:48:35AM +0400, Antony Pavlov wrote:
> > +{
> > + struct rtc_device *r;
> > + struct rtc_time tm;
> > + struct rtc_time stm;
> > + char rtc_name[16] = "rtc0";
> > + char *env_name = NULL;
> > + int opt;
> > + int set = 0;
> > +
> > + while ((opt = getopt(argc, argv, "f:s:e:")) > 0) {
> > + switch (opt) {
> > + case 'f':
> > + strncpy(rtc_name, optarg, 16);
> > + break;
> > + case 's':
> > + memset(&stm, 0, sizeof(stm));
> > + parse_datestr(optarg, &stm);
The result value should really be checked.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list