mcde_sys_net_mount ran in the Xt callback and waited for sshfs/mount_afp without a limit: a server that is gone froze the window for as long as the tool lived (measured: the call returns after 20.0 s with a tool that sleeps 20 s; with one that never ends, never). McdeSys: mcde_sys_net_mount_start/_job_fd/_job_finish/_job_cancel. The tool runs under a runner process (its own process group) that writes the answer to a pipe: dtfile sets SIGCHLD to SIG_IGN (Main.c), where waitpid gives no status. mcde_sys_net_mount and _start share one plan (MountPlanFor). test_job (make check, 5 of 5 pass) covers success, failure, a missing tool, a password on stdin, and cancel with the tool AND what it started gone, with SIGCHLD default and ignored; without the group kill it fails (mutant run). dtfile: _McdeNetMount (NetView.c) for all three mounts (network view, Connect to Server, column view): a modal "Connecting ..." dialog with Cancel (also close button and Escape), the descriptor as Xt input (no timer polling), one time-out, Dtfile*connectTimeout, 20 s, 3..600 (app-defaults, man page). Measured (real dtfile on Xvfb, fake sshfs that sleeps 40 s, connectTimeout 4): the dialog shows and repaints when moved; the time-out gives "Could not connect: The server did not answer within 4 seconds.", Escape gives "Could not connect: Cancelled."; sleep processes while connecting 1, after the time-out 0, after Escape 0; no dialog left. One first run showed a 40 s stall of the whole session after Return (import blocked too); not reproduced in three further runs, cause unknown. Cross compile for NetBSD (x86_64--netbsd-gcc, the build's flags): netmount.c and NetView.c without a warning; common.c's old settimeofday declaration warning is not new. Not done: the NFS and AFP tools (only sshfs was faked), the afp://10.255.255.1/ case of the task with a real mount_afp. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
49 lines
2.4 KiB
C
49 lines
2.4 KiB
C
/*
|
|
* Navigation.h -- MCDE: the navigation parts of the file manager window (Navigation.c)
|
|
*
|
|
* License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
|
|
*/
|
|
|
|
#ifndef _Navigation_h
|
|
#define _Navigation_h
|
|
|
|
/* the form that holds toolbar, sidebar and (after _McdeNavAttachWork) the
|
|
* work area; it becomes the main window's work window */
|
|
extern Widget _McdeNavCreate(FileMgrRec *rec, Widget parent);
|
|
extern void _McdeNavAttachWork(FileMgrRec *rec, Widget work);
|
|
/* called by ShowNewDirectory for every directory the window shows */
|
|
extern void _McdeNavVisit(FileMgrRec *rec, const char *dir);
|
|
/* appends ", 12.3 GB available" to the status text in buf */
|
|
/* go to PATH as the "Go To" dialog does (Columns.c) */
|
|
extern void _McdeNavGoTo(FileMgrRec *rec, const char *path);
|
|
/* a Command-key command of the window (FileMgr.c's McdeKey action):
|
|
* "back", "forward", "icons", "small", "list", "columns", "strip",
|
|
* "computer",
|
|
* "desktop", "applications", "network"; False if it is none of them */
|
|
extern Boolean _McdeNavKey(FileMgrRec *rec, const char *what);
|
|
/* the column view (Columns.c) */
|
|
extern void _McdeColumnsCreate(FileMgrRec *rec, Widget parent, Widget work);
|
|
extern void _McdeColumnsShow(FileMgrRec *rec, Widget work, const char *dir,
|
|
Boolean on);
|
|
extern void _McdeColumnsFollow(FileMgrRec *rec, const char *dir);
|
|
/* the entry the column view has chosen, or NULL; the caller frees it */
|
|
extern char *_McdeColumnsChosen(FileMgrRec *rec);
|
|
/* the network view (NetView.c) */
|
|
extern void _McdeNetCreate(FileMgrRec *rec, Widget parent, Widget work);
|
|
extern void _McdeNetShow(FileMgrRec *rec, Boolean on);
|
|
/* connect URL to the folder MP as mcde_sys_net_mount does (McdeSys), with the
|
|
* window drawing meanwhile: a modal "Connecting ..." dialog with Cancel over
|
|
* PARENT, ended by Cancel or Dtfile*connectTimeout; MCDE_SYS_OK or a failure
|
|
* with mcde_sys_error() (NetView.c) */
|
|
extern int _McdeNetMount(Widget parent, const char *url, const char *mp,
|
|
const char *password);
|
|
/* "Connect to Server": shows the network view with the address field, as
|
|
* Command+K asks for it */
|
|
extern void _McdeNetConnect(FileMgrRec *rec);
|
|
extern void _McdeNavFreeSpace(const char *dir, char *buf, size_t len);
|
|
/* MCDE: the search field of the window of DATA: is NAME hidden by it
|
|
* (FilterFiles in File.c asks for every file) */
|
|
extern Boolean _McdeNavHidden(FileMgrData *data, const char *name);
|
|
|
|
#endif /* _Navigation_h */
|