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.
This commit is contained in:
Stephen Heumann 2018-08-14 20:44:08 -05:00
parent d30dfd8631
commit 85cb0c5971
2 changed files with 8 additions and 1 deletions

4
cdev.c
View File

@ -12,6 +12,7 @@
#include <lineedit.h> #include <lineedit.h>
#include <desk.h> #include <desk.h>
#include <locator.h> #include <locator.h>
#include <tcpip.h>
#include "mounturl.h" #include "mounturl.h"
#define MachineCDEV 1 #define MachineCDEV 1
@ -52,6 +53,8 @@ void DoMount(void)
GetLETextByID(wPtr, urlLine, (StringPtr)&urlBuf); GetLETextByID(wPtr, urlLine, (StringPtr)&urlBuf);
TCPIPConnect(NULL);
mountURLRec.result = NETDISK_NOT_PRESENT; mountURLRec.result = NETDISK_NOT_PRESENT;
mountURLRec.url = urlBuf + 1; mountURLRec.url = urlBuf + 1;
@ -99,6 +102,7 @@ long DoMachine(void)
(Long)&mountURLRec, NULL); (Long)&mountURLRec, NULL);
if (mountURLRec.result == NETDISK_NOT_PRESENT) { if (mountURLRec.result == NETDISK_NOT_PRESENT) {
InitCursor();
AlertWindow(awResource+awButtonLayout, NULL, netDiskMissingError); AlertWindow(awResource+awButtonLayout, NULL, netDiskMissingError);
return 0; return 0;
} }

View File

@ -6,7 +6,7 @@
int main(int argc, char **argv) { int main(int argc, char **argv) {
if (argc < 2) if (argc < 2)
return; return -1;
struct MountURLRec mountURLRec = {sizeof(struct MountURLRec)}; struct MountURLRec mountURLRec = {sizeof(struct MountURLRec)};
mountURLRec.result = NETDISK_NOT_PRESENT; mountURLRec.result = NETDISK_NOT_PRESENT;
@ -17,5 +17,8 @@ int main(int argc, char **argv) {
if (mountURLRec.result != OPERATION_SUCCESSFUL) { if (mountURLRec.result != OPERATION_SUCCESSFUL) {
fprintf(stderr, "MountURL error %u\n", mountURLRec.result); fprintf(stderr, "MountURL error %u\n", mountURLRec.result);
return 1;
} }
return 0;
} }