Skip to content

Commit

Permalink
Merge pull request #88 from wiedi/master
Browse files Browse the repository at this point in the history
fix path detection on SmartOS/illumos
  • Loading branch information
killing authored Dec 17, 2018
2 parents 9706b32 + f9b5546 commit 8e98dfe
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 8e98dfe

Please sign in to comment.