Skip to content

Commit

Permalink
endpoint setup ready systemd notify support.
Browse files Browse the repository at this point in the history
(pr #82)
  • Loading branch information
jfdelnero committed Nov 7, 2023
1 parent c3eb979 commit c820029
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/umtprd.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
#include <pthread.h>
#include <string.h>

#ifdef SYSTEMD_NOTIFY
#include <systemd/sd-login.h>
#include <systemd/sd-daemon.h>
#endif

#include "mtp.h"

#include "usb_gadget.h"
Expand Down Expand Up @@ -85,6 +90,12 @@ static int main_thread(const char *conffile)
if(usb_ctx)
{
mtp_set_usb_handle(mtp_context, usb_ctx, mtp_context->usb_cfg.usb_max_packet_size);

#ifdef SYSTEMD_NOTIFY
/* Tell systemd that we are ready */
sd_notify(0, "READY=1");
#endif

if( mtp_context->usb_cfg.usb_functionfs_mode )
{
PRINT_DEBUG("uMTP Responder : FunctionFS Mode - entering handle_ffs_ep0");
Expand Down

0 comments on commit c820029

Please sign in to comment.