コード例 #1
0
static void p9_xosclient_rerror(struct p9_req_t *req)
{
	struct p9_fcall *rcall;
	u16 tag;
	struct p9_xos_device *dev = (struct p9_xos_device *)req->aux;
	struct p9_xos_endpoint *ep = &dev->driver->ep[RD_EP];
	unsigned long flags;

	if (p9_parse_header(req->tc, &req->tc->size, &req->tc->id, &tag, 1))
		warning("Failed to decode header !");
	kfree(req->tc);
	spin_lock_irqsave(&dev->driver->ep_lock, flags);
	p9_xos_deque_push(ep->rqueue, a2n(req->tc->sdata - 8, ep), ep);
	nb_free_packets++;
	spin_unlock_irqrestore(&dev->driver->ep_lock, flags);

	rcall = kmalloc(sizeof(struct p9_fcall) + 32, GFP_KERNEL);
	p9pdu_reset(rcall);
	rcall->sdata = (u8 *) (rcall + sizeof(struct p9_fcall));
	p9pdu_writef(rcall, 0, "dbwT", 0, P9_RERROR, tag,
		     "9P destination service closed");
	p9pdu_finalize(rcall);

	req->rc = rcall;
	req->tc = NULL;

	spin_lock(&dev->lock);
	dev->ack_count += 1;
	spin_unlock(&dev->lock);

	p9_xos_add_write_request(req, 0);
}
コード例 #2
0
ファイル: GlobalServices.cpp プロジェクト: ldh9451/XLE
    static void SetWorkingDirectory()
    {
            //
            //      For convenience, set the working directory to be ../Working 
            //              (relative to the application path)
            //
        nchar_t appPath     [MaxPath];
        nchar_t appDir      [MaxPath];
        nchar_t workingDir  [MaxPath];

        XlGetProcessPath    (appPath, dimof(appPath));
        XlDirname           (appDir, dimof(appDir), appPath);
        const auto* fn = a2n("..\\Working");
        XlConcatPath        (workingDir, dimof(workingDir), appDir, fn, XlStringEnd(fn));
        XlChDir             (workingDir);
    }