diff options
Diffstat (limited to 'astro/fowsr/files/patch-fowsr.c')
-rw-r--r-- | astro/fowsr/files/patch-fowsr.c | 49 |
1 files changed, 12 insertions, 37 deletions
diff --git a/astro/fowsr/files/patch-fowsr.c b/astro/fowsr/files/patch-fowsr.c index 9e312de81977..d669ffc97906 100644 --- a/astro/fowsr/files/patch-fowsr.c +++ b/astro/fowsr/files/patch-fowsr.c @@ -1,43 +1,18 @@ ---- fowsr.c.orig 2016-07-26 12:57:00 UTC +--- fowsr.c.orig 2016-09-18 13:31:19 UTC +++ fowsr.c -@@ -110,13 +110,17 @@ int CUSB_Open(int vendor, int product) - - signal(SIGTERM, release_usb_device); - -+#ifdef LIBUSB_HAS_GET_DRIVER_NP - ret = usb_get_driver_np(devh, 0, buf, sizeof(buf)); - printf("usb_get_driver_np returned %d\n", ret); - if (ret == 0) { - printf("interface 0 already claimed by driver \\'%s\\', attempting to detach it\n", buf); -+#ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP - ret = usb_detach_kernel_driver_np(devh, 0); - printf("usb_detach_kernel_driver_np returned %d\n", ret); -+#endif - } -+#endif - ret = usb_claim_interface(devh, 0); - if (ret != 0) { - printf("claim failed with error %d\n", ret); -@@ -159,12 +163,14 @@ void CWS_Cache(char isStoring) - FILE* f; - if (isStoring == ISREADING) { +@@ -321,6 +321,7 @@ void CWS_Cache(char isStoring) + + if (isStoring == WS_CACHE_READ) { if (f=fopen(fname,"rb")) { -+ printf("using cache file %s\n", fname); ++ printf("using cache file %s\n", fname); n=fread(&m_previous_timestamp,sizeof(m_previous_timestamp),1,f); n=fread(m_buf,sizeof(m_buf[0]),WS_BUFFER_SIZE,f); } - print_bytes((char *)&m_previous_timestamp, sizeof(time_t)); - } else { // ISWRITING - if (f=fopen(fname,"wb")) { -+ printf("updating cache file %s\n", fname); - n=fwrite(&m_timestamp,sizeof(m_timestamp),1,f); - n=fwrite(m_buf,sizeof(m_buf[0]),WS_BUFFER_SIZE,f); - } -@@ -566,6 +572,7 @@ int CWF_Write(char arg,char* fname) - - FILE* f; - if (f=fopen(fname,"a+s")) { -+ printf("writing to %s\n", fname); +@@ -691,6 +692,7 @@ int CWF_Write(char arg, const char* fnam + f = fopen(s1,"a+t"); + if(!f) + return -1; ++ printf("writing to %s\n", s1); + } - // Header - switch (arg) { + if((old_pos==0)||(old_pos==0xFFFF)) //cachefile empty or empty eeprom was read |