Browse Source

do not try to load sessions that don't exist

tags/v1.6.0
Nils 3 years ago
parent
commit
23f83e5c82
2 changed files with 11 additions and 3 deletions
  1. +3
    -3
      CHANGELOG
  2. +8
    -0
      src/nsmd.cpp

+ 3
- 3
CHANGELOG View File

@@ -11,9 +11,9 @@ nsmd now follows the XDG Base Directory Specifications:
The old path ~/NSM Sessions/ is still supported and has priority, for now. This may be switched off in the future.
Lockfiles fixed (see issue #gh-31)
Lockfiles are now in $XDG_RUNTIME_DIR/nsm/
Lockfiles now each contain the session path, the osc NSM_URL and the nsmd PID.
New section in the API documentation to explain the above.
Lockfiles now each contain the session path, the osc NSM_URL and the nsmd PID
New section in the API documentation for the above.
Fixes and guards against trying to load non-existing sessions and creating new sessions under existing names

## 2022-01-15 1.5.3
Add [jackpatch] to terminal log output of jackpatch.


+ 8
- 0
src/nsmd.cpp View File

@@ -1359,6 +1359,14 @@ tell_all_clients_session_is_loaded ( void )
int
load_session_file ( const char * path )
{
//parameter "path" is the absolute path to the session including session root, without session.nsm

//First check if the session file actually exists, before closing the current one
if ( session_already_exists( basename( strdup(path )) ) != 0) {
WARNING ("Instructed to load %s which does not exist. Doing nothing.", path);
return ERR_NO_SUCH_FILE;
}


if ( session_path && session_name ) {
//We are already in a session. This is switch, or load during duplicate etc.


Loading…
Cancel
Save