Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix process termination. #49

Merged
merged 2 commits into from
Oct 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ if(USE_SSM)
find_package(SSM)
endif(USE_SSM)

include(CheckFunctionExists)
check_function_exists(longjmp HAVE_LONGJMP)
check_function_exists(siglongjmp HAVE_SIGLONGJMP)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/include/config.h
)
Expand Down
6 changes: 5 additions & 1 deletion cmake/config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

#cmakedefine YP_PARAMS_DIR "@YP_PARAMS_DIR@"

#cmakedefine HAVE_SSM "@HAVE_SSM@"
#cmakedefine HAVE_SSM @HAVE_SSM@

#cmakedefine HAVE_LONGJMP @HAVE_LONGJMP@

#cmakedefine HAVE_SIGLONGJMP @HAVE_SIGLONGJMP@

#endif
5 changes: 5 additions & 0 deletions src/param.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ int parameter_set( char param, char id, long long int value64 )
}
value = value64;

if( option( OPTION_WITHOUT_DEVICE ) )
{
return ( 0 );
}

buf[0] = param;
buf[1] = id;
buf[2] = ( ( Int_4Char ) value ).byte[3];
Expand Down
10 changes: 8 additions & 2 deletions src/ypspur-coordinator.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ BOOL WINAPI win32_ctrlc_handler( DWORD type )
if( !option( OPTION_WITHOUT_SSM ) )
end_ypspurSSM( );
#endif
serial_close( );
if( !( option( OPTION_WITHOUT_DEVICE ) ) )
{
serial_close( );
}

return TRUE;
}
Expand All @@ -80,7 +83,10 @@ void emergency( int sig )
if( !option( OPTION_WITHOUT_SSM ) )
end_ypspurSSM( );
#endif
serial_close( );
if( !( option( OPTION_WITHOUT_DEVICE ) ) )
{
serial_close( );
}

exit( 0 );
#endif
Expand Down