Skip to content

Commit

Permalink
fix path detection on SunOS
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedi authored and cuihaikuo committed Dec 24, 2018
1 parent 2483041 commit 5c97331
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion controller/seafile-controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@

#define CHECK_PROCESS_INTERVAL 10 /* every 10 seconds */

#if defined(__sun)
#define PROC_SELF_PATH "/proc/self/path/a.out"
#else
#define PROC_SELF_PATH "/proc/self/exe"
#endif

SeafileController *ctl;

static char *controller_pidfile = NULL;
Expand Down Expand Up @@ -259,7 +265,7 @@ static void
init_seafile_path ()
{
GError *error = NULL;
char *binary = g_file_read_link ("/proc/self/exe", &error);
char *binary = g_file_read_link (PROC_SELF_PATH, &error);
char *tmp = NULL;
if (error != NULL) {
seaf_warning ("failed to readlink: %s\n", error->message);
Expand Down

0 comments on commit 5c97331

Please sign in to comment.