X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-session.c;h=2b649efe4b3a5340bb69794762bf3a21f00d112b;hb=79ccbbb1843431c8b4acb3230e82d5cff415c7a4;hp=77a20fa0d2b90fe910f9917cf7b1553cfe83d55c;hpb=dbb880d5cfab46eba2a3594521c5847fa74c3b70;p=src%2Fapp-framework-binder.git diff --git a/src/afb-session.c b/src/afb-session.c index 77a20fa0..2b649efe 100644 --- a/src/afb-session.c +++ b/src/afb-session.c @@ -250,7 +250,7 @@ static struct afb_session *make_session (const char *uuid, int timeout, time_t n /* generate the uuid */ if (uuid == NULL) { - new_uuid(session->uuid); + do { new_uuid(session->uuid); } while(search(session->uuid)); } else { if (strlen(uuid) >= sizeof session->uuid) { errno = EINVAL; @@ -284,7 +284,7 @@ error: return NULL; } -struct afb_session *afb_session_create (const char *uuid, int timeout) +struct afb_session *afb_session_create (int timeout) { time_t now; @@ -292,13 +292,7 @@ struct afb_session *afb_session_create (const char *uuid, int timeout) now = NOW; cleanup (now); - /* search for an existing one not too old */ - if (uuid != NULL && search(uuid) != NULL) { - errno = EEXIST; - return NULL; - } - - return make_session(uuid, timeout, now); + return make_session(NULL, timeout, now); } // This function will return exiting session or newly created session