Skip to content
Open
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
34 changes: 0 additions & 34 deletions dsmgr/dsMgrMain.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:

Check failure on line 3 in dsmgr/dsMgrMain.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'ISC' license found in local file 'dsmgr/dsMgrMain.c' (Match: rdk/components/generic/iarmmgrs/rdk/components/generic/iarmmgrs/7ff5a0a, 153 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/iarmmgrs/+archive/7ff5a0ad8fb159162bf6e99581c884a2ea97cecb.tar.gz, file: dsmgr/dsMgrMain.c)
*
* Copyright 2016 RDK Management
*
Expand Down Expand Up @@ -33,8 +33,6 @@
extern "C" {
#endif
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include "libIBus.h"
Expand Down Expand Up @@ -80,29 +78,6 @@

#endif

static void dsmgr_signalhandler_thread(int signum)
{
(void)signum; /* signal number unused to keep handler simple and async-signal-safe */

/* Use only async-signal-safe functions in the signal handler */
const char msg[] = "Exiting DSMgr process, calling reboot script\n";
write(STDERR_FILENO, msg, sizeof(msg) - 1);

pid_t pid = fork();
if (pid == 0)
{
/* Child process: execute the reboot script via /bin/sh */
char *const argv[] = { (char *)"sh", (char *)"/rebootNow.sh", (char *)"-s", (char *)"dsMgrMain", NULL };
const char start_msg[] = "Start the rebootNow.sh script\n";
write(STDERR_FILENO, start_msg, sizeof(start_msg) - 1);
execve("/bin/sh", argv, NULL);
const char done_msg[] = "Completed the rebootNow.sh script\n";
write(STDERR_FILENO, done_msg, sizeof(done_msg) - 1);
/* If execve fails, exit the child immediately */
_exit(127);
}
}

int main(int argc, char *argv[])
{
const char* debugConfigFile = NULL;
Expand Down Expand Up @@ -156,15 +131,6 @@
INT_ERROR("DSMgr_Start() failed\n");
return -1;
}
printf("DSMgr Register signal handler\n");

struct sigaction sa;
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART;
sa.sa_handler = dsmgr_signalhandler_thread;

sigaction(SIGABRT, &sa, NULL);
sigaction(SIGSEGV, &sa, NULL);
usleep(10000); // Sleep for 10 milliseconds to allow the d-bus to initialize
#ifdef ENABLE_SD_NOTIFY
sd_notifyf(0, "READY=1\n"
Expand Down
Loading