examples/pager.c
static int pager_notify_close(struct fusd_file_info *file)
{
  struct pager_client *c;

  if ((c = (struct pager_client *) file->private_data) != NULL) {

    /* take this client off our client list */
    client_list_remove(c);

    /* if there is a read outstanding, free the state */
    if (c->read != NULL) {
      fusd_destroy(c->read);
      c->read = NULL;
    }
    /* destroy any outstanding polldiffs */
    if (c->polldiff != NULL) {
      fusd_destroy(c->polldiff);
      c->polldiff = NULL;
    }

    /* get rid of the struct */
    free(c);
    file->private_data = NULL;
  }
  return 0;
}
/* EXAMPLE START pager-close.c */
/* close on /dev/pager/notify: destroy state for this client */
EXAMPLE START pager-close.c
close on /dev/pager/notify: destroy state for this client
EXAMPLE START pager - close . c close on / dev / pager / notify : destroy state for this client
static int pager_notify_close(struct fusd_file_info *file)
{
  struct pager_client *c;
  if ((c = (struct pager_client *) file->private_data) != NULL) {
    client_list_remove(c);
    if (c->read != NULL) {
      fusd_destroy(c->read);
      c->read = NULL;
    }
    if (c->polldiff != NULL) {
      fusd_destroy(c->polldiff);
      c->polldiff = NULL;
    }
    free(c);
    file->private_data = NULL;
  }
  return 0;
}
static int pager_notify_close ( struct fusd_file_info * file ) { struct pager_client * c ; if ( ( c = ( struct pager_client * ) file -> private_data ) != NULL ) { client_list_remove ( c ) ; if ( c -> read != NULL ) { fusd_destroy ( c -> read ) ; c -> read = NULL ; } if ( c -> polldiff != NULL ) { fusd_destroy ( c -> polldiff ) ; c -> polldiff = NULL ; } free ( c ) ; file -> private_data = NULL ; } return 0 ; }
EXAMPLE START pager-close.c
close on /dev/pager/notify: destroy state for this client
EXAMPLE START pager - close . c close on / dev / pager / notify : destroy state for this client
/* take this client off our client list */ /* if there is a read outstanding, free the state */ /* destroy any outstanding polldiffs */ /* get rid of the struct */