[PATCH] Add O_TRUNC when creating cryo file

Sukadev Bhattiprolu sukadev at linux.vnet.ibm.com
Tue Jun 24 15:42:55 PDT 2008


Signed-off-by: Sukadev Bhattiprolu <sukadev at us.ibm.com>
---
 cr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cr.c b/cr.c
index 96a2ea0..b688229 100644
--- a/cr.c
+++ b/cr.c
@@ -1966,7 +1966,7 @@ int main(int argc, char **argv)
 		case 'l':	mode = ch; break;
 		case 's':	cr_mode |= CR_STOP; break;
 		case 'm':	cr_mode |= CR_MMAP; break;
-		case 'p':	mode = ch; fd = 1; perm = O_WRONLY|O_CREAT; pid = (pid_t)atoi(optarg); break;
+		case 'p':	mode = ch; fd = 1; perm = O_WRONLY|O_CREAT|O_TRUNC; pid = (pid_t)atoi(optarg); break;
 		case 'r':	mode = ch; break;
 		case 'f':	strncpy(filename, optarg, sizeof(filename)); break;
 		default:	usage(); exit(1);
-- 
1.5.2.5



More information about the Containers mailing list