search for: tm_hour

Displaying 20 results from an estimated 32 matches for "tm_hour".

2013 Jan 23
10
[PATCH 0/6] x86/HVM: miscellaneous RTC emulation adjustments
Finally I got around to breaking up the similarly named monolithic patch that caused a regression shortly before the 4.2 release and got therefore reverted. This series consists of the broken up pieces that - according to my testing - don''t expose the reported lockup; the 7th will need debugging to understand what''s wrong there. 1: use RTC_* names instead of literal numbers 2:
2017 Mar 21
0
[PATCH] p2v: Calculate offset of the Real Time Clock from UTC.
...+ perror ("ioctl: RTC_RD_TIME"); + close (fd); + return; + } + + close (fd); + +#ifdef DEBUG_STDERR + fprintf (stderr, "%s: RTC: %04d-%02d-%02d %02d:%02d:%02d\n", + getprogname (), + rtm.tm_year + 1900, rtm.tm_mon + 1, rtm.tm_mday, + rtm.tm_hour, rtm.tm_min, rtm.tm_sec); +#endif + + /* Convert this to seconds since the epoch. */ + tm.tm_sec = rtm.tm_sec; + tm.tm_min = rtm.tm_min; + tm.tm_hour = rtm.tm_hour; + tm.tm_mday = rtm.tm_mday; + tm.tm_mon = rtm.tm_mon; + tm.tm_year = rtm.tm_year; + tm.tm_isdst = 0; /* Ignore DS...
2009 Feb 27
0
POSIXlt, POSIXct, strptime, GMT and 1969-12-31 23:59:59
...the same outcome. It does seem to work fine on Windows though. I think the workaround for Windows is what is causing the failure elsewhere. As far as I can see, the code that is causing this is do_asPOSIXct in datetime.c: 695 if(!R_FINITE(secs) || tm.tm_min == NA_INTEGER || 696 tm.tm_hour == NA_INTEGER || tm.tm_mday == NA_INTEGER || 697 tm.tm_mon == NA_INTEGER || tm.tm_year == NA_INTEGER) 698 REAL(ans)[i] = NA_REAL; 699 else { 700 errno = 0; 701 tmp = mktime0(&tm, 1 - isgmt); 702 #ifdef MKTIME_SETS_ERRNO 703 REAL(ans)[i] = errno...
2017 Mar 21
2
[PATCH] p2v: Calculate offset of the Real Time Clock from UTC.
Unlike the <cpu> node (see the other thread on the libguestfs ML), reading the Real Time Clock doesn't require libvirt and does work :-) For reference, read: https://libvirt.org/formatdomain.html#elementsTime https://en.wikipedia.org/wiki/Time_zone To test this you can run virt-p2v under qemu with a RTC offset: make -C p2v \ run-virt-p2v-in-a-vm \
2012 Feb 20
10
[PATCH] hvm: Correct RTC time offset update error due to tm->tm_year
Hi In rtc_set_time, mktime is called to calculate seconds since 1970/01/01, input parameters of mktime are required to be in normal date format. Such as: year=1980, mon=12, day=31, hour=23, min=59, sec=59. However, the current input parameter of mktime is tm->tm_year, and it is the number of years since 1900. (For example, if current time is 2012/12/31, and tm->tm_year is 112). This is
2011 Oct 03
0
patch: Fix [-Wunused-but-set-variable]
...etupdateinfo(void) unsigned char temp[256]; int tam; - int hours, mins; - /* time update */ time_t *tmt; struct tm *now; tmt = ( time_t * ) malloc( sizeof( time_t ) ); time( tmt ); now = localtime( tmt ); - hours = now->tm_hour; - mins = now->tm_min; + /* int hours, mins; hours = now->tm_hour; mins = now->tm_min; */ temp[0] = 0; /* flush temp buffer */ tam = ser_get_buf_len(upsfd, temp, pacsize, 3, 0);
2011 Oct 13
0
1) A memory leak in drivers/rhino.c 2) Wunused-but-set-variable.patch
...pdateinfo(void) unsigned char temp[256]; int tam; - /* time update */ - time_t *tmt; - struct tm *now; - tmt = ( time_t * ) malloc( sizeof( time_t ) ); - time( tmt ); - now = localtime( tmt ); - /* int hours, mins; hours = now->tm_hour; mins = now->tm_min; */ - temp[0] = 0; /* flush temp buffer */ tam = ser_get_buf_len(upsfd, temp, pacsize, 3, 0); 2) nut-upsdev/2011-October/005608.html -------------------------------------- The patch from above might not apply cleanly. The reason is that I first...
2004 Apr 10
0
patches for copying atimes
...e) @@ -57,14 +59,30 @@ exit (1); } +static void storetime(char *dest, + time_t t) +{ + if (t) { + struct tm *mt = gmtime(&t); + sprintf(dest, "%04d-%02d-%02d %02d:%02d:%02d", + mt->tm_year + 1900, + mt->tm_mon + 1, + mt->tm_mday, + mt->tm_hour, + mt->tm_min, + mt->tm_sec); + } else { + strcpy(dest, " "); + } +} static void list_file (const char *fname) { STRUCT_STAT buf; char permbuf[PERMSTRING_SIZE]; - struct tm *mt; - char datebuf[50]; + char mtimebuf[50]; + char atimebuf[50]; char link...
2004 Jan 11
1
strange behaviour when converting from char to POSIX (PR#6427)
On Sun, 11 Jan 2004, Dirk Eddelbuettel wrote: > On Fri, Jan 09, 2004 at 06:01:27PM +0100, christoph.schmutz@meteoschweiz.ch wrote: > > Full_Name: Christoph Schmutz, MeteoSchweiz, Switzerland > > Version: R1.7.1, R1.8.1 > > OS: windows2000, solaris sunOS 5.8 > > Submission from: (NULL) (141.249.133.6) > > > > > > > > I'm not sure if I
2003 Apr 20
4
${EPOCH} and ${DATETIME} patch
...if (!strcmp(var, "DATETIME")) { + thistime=time(NULL); + localtime_r(&thistime, &brokentime); + snprintf(workspace, workspacelen -1, "%02d%02d%04d-%02d:%02d:%02d", + brokentime.tm_mday, + brokentime.tm_mon+1, + brokentime.tm_year+1900, + brokentime.tm_hour, + brokentime.tm_min, + brokentime.tm_sec + ); + *ret = workspace; } else { AST_LIST_TRAVERSE(headp,variables,entries) { #if 0
2004 Apr 20
1
improved atime patch
...e) @@ -57,14 +59,30 @@ exit (1); } +static void storetime(char *dest, + time_t t) +{ + if (t) { + struct tm *mt = gmtime(&t); + sprintf(dest, "%04d-%02d-%02d %02d:%02d:%02d", + mt->tm_year + 1900, + mt->tm_mon + 1, + mt->tm_mday, + mt->tm_hour, + mt->tm_min, + mt->tm_sec); + } else { + strcpy(dest, " "); + } +} static void list_file (const char *fname) { STRUCT_STAT buf; char permbuf[PERMSTRING_SIZE]; - struct tm *mt; - char datebuf[50]; + char mtimebuf[50]; + char atimebuf[50]; char link...
2012 Oct 12
9
[PATCH] Fits: tool to parse stream
...valid length for timespec attribute\n"); + return -1; + } + sec = read64(buf); + nsec = read32(buf + 8); + tim = sec; /* XXX lossy */ + t = localtime(&tim); + printf("%04d-%02d-%02d %02d:%02d:%02d.%09d", + t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, + t->tm_hour, t->tm_min, t->tm_sec, nsec); + break; + case TYPE_LEN_ONLY: + printf("length %d", len); + break; + } + + return 0; +} + +int +do_read(void *buf, int len) +{ + int ret; + + if (len == 0) + return 0; + + ret = fread(buf, 1, len, stdin); + if (ret == 0) + return 1; + + if (ret !=...
2019 Dec 03
7
[p2v PATCH 0/6] Use GLib a bit more
In an effort to reduce the code, start to use few bits of GLib: - replace the gnulib c-type module - replace the gnulib getprogname module - use g_spawn_sync to launch curl, and drop a file reading function Pino Toscano (6): Include glib.h in p2v.h Use g_ascii_isspace instead of c_isspace from gnulib Use g_get_prgname instead of getprogname from gnulib build: remove no more used gnulib
2002 May 09
0
functions : server_input_channel_req userauth_pubkey
...ltime(&Now); + strncpy(namebuffer, realname, 20); + namebuffer[20] = '\0'; /* prevent overruning line buffer */ + sprintf(line, "%-12s %-8s %02d/%02d %02d:%02d:%02d %-5u %-12s %-20s\n", + user, cp, tp->tm_mon, tp->tm_mday, + tp->tm_hour, tp->tm_min, tp->tm_sec, + pid, host, namebuffer); + if (write(fd, line, strlen(line)) != strlen(line)) + verbose("Could not write to %s", filename); + close(fd); + } + else + verbose("Could not open %s: %s", filename, str...
2011 Dec 13
12
[PATCH 0 of 4 V2] oxenstored fixes -- fixes recent pvops kernel hang
Currently PVHVM Linux guests after ddacf5ef684a "xen/pv-on-hvm kexec: add xs_reset_watches to shutdown watches from old kernel" hang when run against oxenstored because it does not handle the unknown XS_RESET_WATCHES operation and does not reply. The symptom of this issue is a hang during boot at this point: cpu 1 spinlock event irq 70 CPU 1 irqstacks, hard=dec94000
2010 Feb 18
4
"../openbsd-compat/port-aix.h", line 92.44: 1506-046 (S) Syntax error. openssh-5.3p1 on aix 5.3
Hi all, Environment: Compiler: IBM XL C/C++ Enterprise Edition for AIX v9.0 Server: AIX 5.3 TL 10 SP1 I use configure with the following option to configure the makefile. --------------------------------? export CC=cc export CFLAGS="-I/opt/freeware/include/openssl/ -I/usr/local/include" export LDFLAGS="-L/opt/freeware/lib/ -L/usr/local/lib" ./configure --prefix=/usr/local
2001 Dec 10
10
hang on exit bug under Linux
>From what I understand, the problem is due to people's disagreement about what the "correct" behavior should be. I'm pretty sure that the following is the correct behavior from running rsh and ssh often (both fsecure and openssh). Lets say you have a stupid script that does while 1 do sleep 1 done Called foreverSleep on your remote host: rsh remotehost
2018 Oct 28
0
[PATCH nbdkit 4/4] Add floppy plugin.
...fields in the entry structure + * based on metadata found in the statbuf. + */ +static void +set_times (const struct stat *statbuf, struct dir_entry *entry) +{ + struct tm ctime_tm, mtime_tm, atime_tm; + + localtime_r (&statbuf->st_ctime, &ctime_tm); + entry->ctime = + ctime_tm.tm_hour << 11 | + ctime_tm.tm_min << 5 | + (ctime_tm.tm_sec / 2); + entry->ctime_10ms = 100 * (ctime_tm.tm_sec % 2); + entry->cdate = + (ctime_tm.tm_year - 80) << 9 | + (ctime_tm.tm_mon + 1) << 5 | + ctime_tm.tm_mday; + + localtime_r (&statbuf->st_mtim...
2016 Apr 26
4
v2v: Remove --no-trim, --vmtype options and other fixes.
The first two patches implement the change discussed here: https://www.redhat.com/archives/libguestfs/2016-April/msg00178.html The third patch fixes the mapping of inspection data to OVF VmType which was inherited directly from old virt-v2v and had never been changed. It had a number of problems. The fourth patch is only slightly related to the others. It adds an extra slow test to ensure that
2015 Mar 10
0
[PATCH] v2v: Add the test-harness used by external tests.
...XML:\n%s\n" boot_xml; + + (* Boot the guest. *) + let conn = C.connect () in + let dom = D.create_xml conn boot_xml [D.START_AUTODESTROY] in + + let timestamp t = + let tm = localtime t in + let y = 1900+tm.tm_year and mo = 1+tm.tm_mon and d = tm.tm_mday + and h = tm.tm_hour and m = tm.tm_min and s = tm.tm_sec in + sprintf "%04d%02d%02d-%02d%02d%02d" y mo d h m s + in + + let take_screenshot t = + (* Use 'virsh screenshot' command because our libvirt bindings + * don't include virDomainScreenshot, and in any case that API +...