/*
- * $Id: util.h,v 1.16 2009-11-23 18:17:30 didg Exp $
+ * $Id: util.h,v 1.17 2010-01-05 13:48:47 franklahm Exp $
*/
#ifndef _ATALK_UTIL_H
* IPv6 mapped IPv4 addresses are treated as IPv4 addresses.
*/
extern int compare_ip(const struct sockaddr *sa1, const struct sockaddr *sa2);
+
+/******************************************************************
+ * unix.c
+ *****************************************************************/
+
+/*!
+ * @brief get cwd in static buffer
+ *
+ * @returns pointer to path or pointer to error messages on error
+ */
+extern const char *getcwdpath(void);
/*
- * $Id: ad_open.c,v 1.62 2010-01-05 12:06:34 franklahm Exp $
+ * $Id: ad_open.c,v 1.63 2010-01-05 13:48:47 franklahm Exp $
*
* Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* here.
* if ((oflags & O_CREAT) ==> (oflags & O_RDWR)
*/
+ LOG(logtype_default, log_debug, "ad_open: creating new adouble file: %s/%s", getcwdpath(), ad_p);
admode = mode;
errno = 0;
st_invalid = ad_mode_st(ad_p, &admode, &st_dir);
--- /dev/null
+/*
+ $Id: unix.c,v 1.1 2010-01-05 13:48:47 franklahm Exp $
+ Copyright (c) 2010 Frank Lahm <franklahm@gmail.com>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <unistd.h>
+#include <stdint.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <dirent.h>
+
+#include <atalk/adouble.h>
+#include <atalk/ea.h>
+#include <atalk/afp.h>
+#include <atalk/logger.h>
+#include <atalk/volume.h>
+#include <atalk/vfs.h>
+#include <atalk/util.h>
+#include <atalk/unix.h>
+
+extern const char *getcwdpath(void)
+{
+ static char cwd[MAXPATHLEN + 1];
+ char *p;
+
+ if ((p = getcwd(&cwd, MAXPATHLEN)) != NULL)
+ return p;
+ else
+ return strerror(errno);
+}