src/hello.c
changeset 27 461be4cd34a3
parent 7 3a603d755bcb
equal deleted inserted replaced
26:61668c57f4bb 27:461be4cd34a3
    94         fuse_reply_err(req, ENOTDIR);
    94         fuse_reply_err(req, ENOTDIR);
    95         return;
    95         return;
    96     }
    96     }
    97 
    97 
    98     // fill in the dirbuf
    98     // fill in the dirbuf
    99     if (dirbuf_init(&buf, size))
    99     if (dirbuf_init(&buf, size, off))
   100         ERROR("failed to init dirbuf");
   100         ERROR("failed to init dirbuf");
   101 
   101 
   102     err =   dirbuf_add(req, off, &buf, 0, 1,  ".",        1,    S_IFDIR )
   102     err =   dirbuf_add(req, &buf, 0, 1,  ".",        1,    S_IFDIR )
   103         ||  dirbuf_add(req, off, &buf, 1, 2,  "..",       1,    S_IFDIR )
   103         ||  dirbuf_add(req, &buf, 1, 2,  "..",       1,    S_IFDIR )
   104         ||  dirbuf_add(req, off, &buf, 2, 3,  file_name,  2,    S_IFREG );
   104         ||  dirbuf_add(req, &buf, 2, 3,  file_name,  2,    S_IFREG );
   105 
   105 
   106     if (err < 0)
   106     if (err < 0)
   107         ERROR("failed to add dirents to buf");
   107         ERROR("failed to add dirents to buf");
   108     
   108     
   109     // send it
   109     // send it
   232     // clean shutdown
   232     // clean shutdown
   233 
   233 
   234 error :
   234 error :
   235     // cleanup
   235     // cleanup
   236     if (ctx.ev_fuse)
   236     if (ctx.ev_fuse)
   237         evfuse_close(ctx.ev_fuse);
   237         evfuse_free(ctx.ev_fuse);
   238     
   238     
   239     if (ctx.signals)
   239     if (ctx.signals)
   240         signals_free(ctx.signals);
   240         signals_free(ctx.signals);
   241 
   241 
   242     if (ctx.ev_base)
   242     if (ctx.ev_base)