52 lines
1.4 KiB
Text
52 lines
1.4 KiB
Text
$NetBSD: patch-aa,v 1.3 2008/08/02 18:32:15 dholland Exp $
|
|
|
|
Add support for NetBSD and Solaris
|
|
Make sure the program is being run by effective uid 0
|
|
Bug fix: time_t != long.
|
|
|
|
--- app.cpp.orig 1999-06-11 12:26:46.000000000 -0400
|
|
+++ app.cpp 2008-08-02 14:25:08.000000000 -0400
|
|
@@ -67,6 +67,20 @@
|
|
#define SIZE_MAXPATH MAXPATH
|
|
#define DELETEARRAY delete
|
|
|
|
+#elif defined(__NetBSD__)
|
|
+ // NetBSD g++
|
|
+ #include <unistd.h>
|
|
+ #include <sys/syslimits.h>
|
|
+ #define SIZE_MAXPATH PATH_MAX
|
|
+ #define DELETEARRAY delete[]
|
|
+
|
|
+#elif defined(__sun__) && defined(__svr4__)
|
|
+ // Solaris 2.x g++
|
|
+ #include <unistd.h>
|
|
+ #include <limits.h>
|
|
+ #define SIZE_MAXPATH PATH_MAX
|
|
+ #define DELETEARRAY delete[]
|
|
+
|
|
#else
|
|
// not supported
|
|
#error ! ! compiler/platform not supported ! !
|
|
@@ -97,7 +111,7 @@
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// return pointer to static string containing datetime
|
|
-static char* TimeStr( long lValue )
|
|
+static char* TimeStr( time_t lValue )
|
|
{
|
|
static char szBuf[ 64 ];
|
|
struct tm* psDateTime;
|
|
@@ -519,6 +533,13 @@ int main( int iCountArg, char* paszArg[]
|
|
Help();
|
|
CLEANUP_RETURN( FALSE );
|
|
}
|
|
+#if defined(__NetBSD__)
|
|
+ if (geteuid() != 0) {
|
|
+ ERRORSTR("You need to be root to run this program,\n");
|
|
+ ERRORSTR("because access is made to the parallel port directly.\n");
|
|
+ CLEANUP_RETURN(FALSE);
|
|
+ }
|
|
+#endif
|
|
for( int iA=1; iA<iCountArg; ++iA )
|
|
{
|
|
// check for display directory request
|