Skip to contentSkip to conversation

Add O_TRUNC when creating cryo file

PATCH Applied sukadev-r/[email protected] 2 participants 2 messages Jun 24, 2008 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add O_TRUNC when creating cryo file

From 9b4dff531586c8dd0b0c75b17ef9ea3e5efc4d0e Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <[email protected]>
Date: Tue, 24 Jun 2008 15:42:55 -0700
Subject: [PATCH] Add O_TRUNC when creating cryo file

---
 cr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
cr.c +1 -1
index 96a2ea0..b688229 100644
@@ -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);
Signature · 1 line
1.5.2.5

A message that is not in the archive (sent off-list or not yet received): 20080624224957.GA22681-r/[email protected]

#2 lore raw
Quoted 6 lines · Quoting sukadev-r/[email protected]…
Quoted 1 line

From 9b4dff531586c8dd0b0c75b17ef9ea3e5efc4d0e Mon Sep 17 00:00:00 2001

From: Sukadev Bhattiprolu <[email protected]>
Date: Tue, 24 Jun 2008 15:42:55 -0700
Subject: [PATCH] Add O_TRUNC when creating cryo file

Thanks, applied.

-serge

Quoted 19 lines
---
 cr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
cr.c +1 -1
index 96a2ea0..b688229 100644
@@ -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);
Signature · 1 line
1.5.2.5