| @@ -1,26 +1,17 @@ | | | @@ -1,26 +1,17 @@ |
1 | $NetBSD: patch-ai,v 1.6 2009/08/15 17:04:52 wiz Exp $ | | 1 | $NetBSD: patch-ai,v 1.7 2009/09/03 11:58:45 wiz Exp $ |
2 | | | 2 | |
3 | --- vcs/clearcase/clearcasemanipulator.cpp.orig 2008-03-30 00:56:29.000000000 +0000 | | 3 | --- vcs/clearcase/clearcasemanipulator.cpp.orig 2008-03-30 00:56:29.000000000 +0000 |
4 | +++ vcs/clearcase/clearcasemanipulator.cpp | | 4 | +++ vcs/clearcase/clearcasemanipulator.cpp |
5 | @@ -20,10 +20,10 @@ | | 5 | @@ -19,8 +19,11 @@ |
| | | 6 | #include <stdlib.h> |
6 | #include <libgen.h> | | 7 | #include <libgen.h> |
7 | #include <errno.h> | | 8 | #include <errno.h> |
| | | 9 | +#ifdef __NetBSD__ |
| | | 10 | +#include <sys/param.h> |
| | | 11 | +#endif |
8 | | | 12 | |
9 | -#if defined(Q_OS_MACX) || defined(MACOSX) || defined(Q_OS_SOLARIS) || defined(Q_OS_FREEBSD) | | 13 | -#if defined(Q_OS_MACX) || defined(MACOSX) || defined(Q_OS_SOLARIS) || defined(Q_OS_FREEBSD) |
10 | +#if defined(Q_OS_MACX) || defined(MACOSX) || defined(Q_OS_SOLARIS) || defined(Q_OS_FREEBSD) || defined(__NetBSD__) || defined(__DragonFly__) | | 14 | +#if defined(Q_OS_MACX) || defined(MACOSX) || defined(Q_OS_SOLARIS) || defined(Q_OS_FREEBSD) || (defined(__NetBSD__) && (__NetBSD_Version__ < 599001500)) || defined(__DragonFly__) |
11 | //this function is taken from GNU libc | | 15 | //this function is taken from GNU libc |
12 | //it does not exist on macos | | 16 | //it does not exist on macos |
13 | -int getline(char **lineptr, size_t *n, FILE *stream) | | 17 | int getline(char **lineptr, size_t *n, FILE *stream) |
14 | +int get_line(char **lineptr, size_t *n, FILE *stream) | | | |
15 | { | | | |
16 | static char line[256]; | | | |
17 | char *ptr; | | | |
18 | @@ -95,7 +95,7 @@ VCSFileInfoMap* ClearcaseManipulator::re | | | |
19 | char* line = NULL; | | | |
20 | size_t numRead; | | | |
21 | while (!feof(outputFile)) { | | | |
22 | - getline(&line,&numRead,outputFile); | | | |
23 | + get_line(&line,&numRead,outputFile); | | | |
24 | | | | |
25 | if (numRead > 0) { | | | |
26 | int pos = 0; | | | |