From 85cb0c5971567c049ff899c3ff3e65d9aa7c859e Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Tue, 14 Aug 2018 20:44:08 -0500 Subject: [PATCH] CDev and mounturl tweaks. The CDev connects to the network if not already connected, and it displays the arrow cursor in the "no NetDiskInit" alert from MachineCDEV. The mounturl utility now has meaningful return values. --- cdev.c | 4 ++++ mounturl.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cdev.c b/cdev.c index 8f25e7c..3a1f2a1 100644 --- a/cdev.c +++ b/cdev.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "mounturl.h" #define MachineCDEV 1 @@ -52,6 +53,8 @@ void DoMount(void) GetLETextByID(wPtr, urlLine, (StringPtr)&urlBuf); + TCPIPConnect(NULL); + mountURLRec.result = NETDISK_NOT_PRESENT; mountURLRec.url = urlBuf + 1; @@ -99,6 +102,7 @@ long DoMachine(void) (Long)&mountURLRec, NULL); if (mountURLRec.result == NETDISK_NOT_PRESENT) { + InitCursor(); AlertWindow(awResource+awButtonLayout, NULL, netDiskMissingError); return 0; } diff --git a/mounturl.c b/mounturl.c index ab5125a..7cfc78e 100644 --- a/mounturl.c +++ b/mounturl.c @@ -6,7 +6,7 @@ int main(int argc, char **argv) { if (argc < 2) - return; + return -1; struct MountURLRec mountURLRec = {sizeof(struct MountURLRec)}; mountURLRec.result = NETDISK_NOT_PRESENT; @@ -17,5 +17,8 @@ int main(int argc, char **argv) { if (mountURLRec.result != OPERATION_SUCCESSFUL) { fprintf(stderr, "MountURL error %u\n", mountURLRec.result); + return 1; } + + return 0; }