syscall_emul.cc (10559:62f5f7363197) | syscall_emul.cc (10633:ae3b12c845b8) |
---|---|
1/* 2 * Copyright (c) 2003-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 386 unchanged lines hidden (view full) --- 395 buf.copyOut(tc->getMemProxy()); 396 397 return (result == -1) ? -errno : result; 398} 399 400SyscallReturn 401unlinkFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) 402{ | 1/* 2 * Copyright (c) 2003-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 386 unchanged lines hidden (view full) --- 395 buf.copyOut(tc->getMemProxy()); 396 397 return (result == -1) ? -errno : result; 398} 399 400SyscallReturn 401unlinkFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) 402{ |
403 return unlinkHelper(desc, num, p, tc, 0); 404} 405 406SyscallReturn 407unlinkHelper(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc, 408 int index) 409{ |
|
403 string path; 404 | 410 string path; 411 |
405 int index = 0; | |
406 if (!tc->getMemProxy().tryReadString(path, p->getSyscallArg(tc, index))) 407 return -EFAULT; 408 409 // Adjust path for current working directory 410 path = p->fullPath(path); 411 412 int result = unlink(path.c_str()); 413 return (result == -1) ? -errno : result; --- 484 unchanged lines hidden --- | 412 if (!tc->getMemProxy().tryReadString(path, p->getSyscallArg(tc, index))) 413 return -EFAULT; 414 415 // Adjust path for current working directory 416 path = p->fullPath(path); 417 418 int result = unlink(path.c_str()); 419 return (result == -1) ? -errno : result; --- 484 unchanged lines hidden --- |