mirror of
https://github.com/sheumann/NetDisk.git
synced 2024-11-23 22:37:02 +00:00
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:
parent
d30dfd8631
commit
85cb0c5971
4
cdev.c
4
cdev.c
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user