Hi, Andrew. Thanks for the report.

On Mon, 17 Feb 2003, Andrew A. Raines wrote:
>New errors for this release:
>   aar@mays:/usr/local/src/bincimap-1.0.23(182)$ gmake
>   [...]
>   g++ -DHAVE_CONFIG_H -I. -I. -I../..   -I/usr/local/include  -g -O2 -c -o 
>bincimap-uidpwd.o `test -f 'bincimap-uidpwd.cc' || echo './'`bincimap-uidpwd.cc
>   bincimap-uidpwd.cc: In function `int main()':
>   bincimap-uidpwd.cc:49: implicit declaration of function `int 
>get_current_dir_name(...)'

This is a POSIX function, and I was hoping that it would work fine under 
OpenBSD. I didn't have the time to check, however. Here's a patch that 
will solve your problem for now:

diff -u -r1.5 bincimap-uidpwd.cc
--- src/auth/bincimap-uidpwd.cc 16 Feb 2003 18:10:43 -0000      1.5
+++ src/auth/bincimap-uidpwd.cc 17 Feb 2003 19:43:38 -0000
@@ -36,8 +36,6 @@
 #include <config.h>
 #endif

-#define _GNU_SOURCE
-
 #include <unistd.h>
 #include <iostream>

@@ -45,6 +43,19 @@

 int main(void)
 {
+  int bufsize = 4096;
+  char *cwd = new char[bufsize];
+  if (getcwd(cwd, bufsize) == 0)
+    switch (errno) {
+    case EACCES:
+    case EFAULT:
+    case EINVAL:
+    case ENOENT:
+    case ERANGE:
+    default:
+      return 111;
+    }
+
   cout << getuid() << "." << getgid() << endl;
-  cout << get_current_dir_name() << endl;
+  cout << cwd << endl;
 }


Reply via email to