OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] Add O_TRUNC when creating cryo file
[PATCH] Add O_TRUNC when creating cryo file [message #31330] Tue, 24 June 2008 22:49 Go to next message
Sukadev Bhattiprolu is currently offline  Sukadev Bhattiprolu
Messages: 413
Registered: August 2006
Senior Member
From: openvz.org
>From 9b4dff531586c8dd0b0c75b17ef9ea3e5efc4d0e Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Date: Tue, 24 Jun 2008 15:42:55 -0700
Subject: [PATCH] Add O_TRUNC when creating cryo file

Signed-off-by: Sukadev Bhattiprolu <sukadev@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

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH] Add O_TRUNC when creating cryo file [message #31331 is a reply to message #31330] Tue, 24 June 2008 23:03 Go to previous message
serue is currently offline  serue
Messages: 750
Registered: February 2006
Senior Member
From: openvz.org
Quoting sukadev@us.ibm.com (sukadev@us.ibm.com):
> >From 9b4dff531586c8dd0b0c75b17ef9ea3e5efc4d0e Mon Sep 17 00:00:00 2001
> From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
> Date: Tue, 24 Jun 2008 15:42:55 -0700
> Subject: [PATCH] Add O_TRUNC when creating cryo file
> 
> Signed-off-by: Sukadev Bhattiprolu <sukadev@us.ibm.com>

Thanks, applied.

-serge

> ---
>  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
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Previous Topic: Obtaining the latest kernel to test out the latest on the containers
Next Topic: [PATCH 0/8] CGroup Files: Add write_string control file method
Goto Forum:
  


Current Time: Tue Dec 10 00:33:02 GMT 2019