Closed Bug 455259 Opened 11 years ago Closed 11 years ago

nsinstall gives 'text file busy' when trying to overwrite a running build

Categories

(Firefox Build System :: General, defect)

x86
Linux
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: roc, Assigned: roc)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch fix (obsolete) — Splinter Review
On my Linux box, I get 'text file busy' when building in an objdir where there's a currently running build. It seems nsinstall's 'access' call is returning OK but the open fails.

IMHO calling 'access' is a waste of time. We should just try to create and open the file. If that fails, then we should try to remove the existing file or directory if there is one, and then retry the create-and-open.
Attachment #338563 - Flags: review?(benjamin)
Attached patch fix v2Splinter Review
Sorry Karl pointed out that we should check ISREG before attempting to write, because we want to remove a link if there's one there.
Attachment #338566 - Flags: review?(benjamin)
Attachment #338566 - Flags: review?(benjamin) → review+
Attachment #338563 - Attachment is obsolete: true
Attachment #338563 - Flags: review?(benjamin)
Pushed 974c9bb54ffa
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
>diff --git a/config/nsinstall.c b/config/nsinstall.c

>+  if (exists) {
>+    if (S_ISREG(tosb.st_mode)) {
>+      /* See if we can open it. This is more reliable than 'access'. */
>+      tofd = open(toname, O_CREAT | O_WRONLY, 0666);

FWIW: this file descriptor is leaked.
Is that so? It looks to me like it's closed in "if (close(tofd) < 0)" further down.
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.