summaryrefslogtreecommitdiff
path: root/lib/amigaos.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-07-13 18:06:40 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-07-13 18:06:40 +0000
commit16bbd13af7244cc0967d9f12327f63ffcaeac4bd (patch)
tree345f4e74a520be8b1ef6cae6bd9a171938198b79 /lib/amigaos.c
parentee0666c8df0022a13fd478fe4a916f647a6338c5 (diff)
downloadcurl-16bbd13af7244cc0967d9f12327f63ffcaeac4bd.tar.gz
Diego Casorran patches to make (lib)curl build fine on Amiga again
Diffstat (limited to 'lib/amigaos.c')
-rw-r--r--lib/amigaos.c55
1 files changed, 40 insertions, 15 deletions
diff --git a/lib/amigaos.c b/lib/amigaos.c
index 13336ce05..95442a533 100644
--- a/lib/amigaos.c
+++ b/lib/amigaos.c
@@ -22,28 +22,53 @@
***************************************************************************/
#include "amigaos.h"
-#include <stdio.h> /* for stderr */
+#include <amitcp/socketbasetags.h>
struct Library *SocketBase = NULL;
+extern int errno, h_errno;
+
+#ifdef __libnix__
+#include <stabs.h>
+void __request(const char *msg);
+#else
+# define __request( msg ) Printf( msg "\n\a")
+#endif
void amiga_cleanup()
{
- if(SocketBase)
- CloseLibrary(SocketBase);
-
- SocketBase = NULL;
+ if(SocketBase) {
+ CloseLibrary(SocketBase);
+ SocketBase = NULL;
+ }
}
BOOL amiga_init()
{
- if(!SocketBase)
- SocketBase = OpenLibrary("bsdsocket.library", 4);
-
- if(!SocketBase) {
- fprintf(stderr, "No TCP/IP Stack running!\n\a");
- return FALSE;
- }
-
- atexit(amiga_cleanup);
- return TRUE;
+ if(!SocketBase)
+ SocketBase = OpenLibrary("bsdsocket.library", 4);
+
+ if(!SocketBase) {
+ __request("No TCP/IP Stack running!");
+ return FALSE;
+ }
+
+ if(SocketBaseTags(
+ SBTM_SETVAL(SBTC_ERRNOPTR(sizeof(errno))), (ULONG) &errno,
+// SBTM_SETVAL(SBTC_HERRNOLONGPTR), (ULONG) &h_errno,
+ SBTM_SETVAL(SBTC_LOGTAGPTR), (ULONG) "cURL",
+ TAG_DONE)) {
+
+ __request("SocketBaseTags ERROR");
+ return FALSE;
+ }
+
+#ifndef __libnix__
+ atexit(amiga_cleanup);
+#endif
+
+ return TRUE;
}
+
+#ifdef __libnix__
+ADD2EXIT(amiga_cleanup,-50);
+#endif