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

Re: [Pkg-owncloud-maintainers] FTBS ocsync & qtkeychain



On Thu, 2013-09-19 at 10:30 +0200, Sandro Knauß wrote:
> Hey,
> 
> Wooh that is fast! Please send the patch to pkg-owncloud-
> maintainers@lists.alioth.debian.org. I'm not subscribed at debian-hurd :) 
> 
> sandro
> 
> --
> Am Donnerstag, 19. September 2013, 08:13:48 schrieb Svante Signell:
> > On Thu, 2013-09-19 at 00:11 +0200, Sandro Knauß wrote:
> > > Hey,
> > > 
> > > I really like to get owncloud-client running in hurd.  Two build-deps are
> > > not build in hurd.
> > > 
> > > till now building ocsync fails with [1]:
> > > 
> > > src/csync_misc.c: In function 'csync_get_user_home_dir':
> > > src/csync_misc.c:91:15: error: 'PATH_MAX' undeclared (first use in this
> > > function)
> > > 
> > >      char home[PATH_MAX] = {0};
> > 
> > I have a patch for ocsync. Do you want it sent here  to the debian-hurd
> > ML, or should I file a bug in the Debian BTS?
> > 
> > Svante

The patch is attached. Additionally, the freebsd patch is modified to
include errno.h for definition of ENODATA and EPIPE. The compiler
complains that EPIPE is not defined otherwise. Maybe this file can be
included unconditionally, without harm. I wonder how the error codes are
defined for freebsd if errno.h is not included?

Thanks,
Svante Signell
--- a/src/csync_misc.c	2013-09-04 11:15:42.000000000 +0200
+++ b/src/csync_misc.c	2013-09-19 07:09:54.000000000 +0200
@@ -88,20 +88,15 @@ char *csync_get_local_username(void) {
 #endif /* NSS_BUFLEN_PASSWD */
 
 char *csync_get_user_home_dir(void) {
-    char home[PATH_MAX] = {0};
-    const char *envp;
+    static const char *home = NULL;
     struct passwd pwd;
     struct passwd *pwdbuf;
     char buf[NSS_BUFLEN_PASSWD];
     int rc;
 
-    envp = getenv("HOME");
-    if (envp != NULL) {
-        snprintf(home, sizeof(home), "%s", envp);
-        if (home[0] != '\0') {
-            return c_strdup(home);
-        }
-    }
+    home = getenv("HOME");
+    if (home)
+      return c_strdup(home);
 
     /* Still nothing found, read the password file */
     rc = getpwuid_r(getuid(), &pwd, buf, NSS_BUFLEN_PASSWD, &pwdbuf);
Description: To be able to compile ocsync under FreeBSD.
Author: Sandro KnauÃ? <bugs@sandroknauss.de>
Last-Update: 2013-09-11
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/std/c_private.h
+++ b/src/std/c_private.h
@@ -26,6 +26,10 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#ifdef __GNU__
+#include <errno.h>
+#endif
+
 #ifdef _WIN32
 #include <windef.h>
 #include <winbase.h>
@@ -50,6 +54,11 @@
 #define geteuid() 0
 #endif
 
+#ifndef ENODATA
+#define ENODATA EPIPE
+#endif
+
+
 #ifdef _WIN32
 typedef struct stat64 csync_stat_t;
 #define _FILE_OFFSET_BITS 64
--- a/src/std/c_string.c
+++ b/src/std/c_string.c
@@ -307,7 +307,7 @@
 #ifdef WITH_ICONV
   dst = c_iconv(wstr, iconv_from_native);
 #else
-  dst = wstr;
+  dst = (char*) wstr;
 #endif
 #endif
   return dst;
@@ -334,7 +334,7 @@
 #ifdef WITH_ICONV
   dst = c_iconv(str, iconv_to_native);
 #else
-  dst = str;
+  dst = (_TCHAR*) str;
 #endif
 #endif
   return dst;

Reply to: