Opened 15 years ago

Closed 4 years ago

#224 closed patch (fixed)

IZ1443: code cleanup in builtin_starter.c:start_command()

Reported by: uddeborg Owned by: Dave Love <d.love@…>
Priority: normal Milestone:
Component: sge Version: 6.0u3
Severity: minor Keywords: patch execution
Cc:

Description

[Imported from gridengine issuezilla http://gridengine.sunsource.net/issues/show_bug.cgi?id=1443]

        Issue #:      1443             Platform:     All     Reporter: uddeborg (uddeborg)
       Component:     gridengine          OS:        All
     Subcomponent:    execution        Version:      6.0u3      CC:    None defined
        Status:       NEW              Priority:     P3
      Resolution:                     Issue type:    TASK
                                   Target milestone: ---
      Assigned to:    andreas (andreas)
      QA Contact:     pollinger
          URL:
       * Summary:     code cleanup in builtin_starter.c:start_command()
   Status whiteboard:
      Attachments:
                      Date/filename:                     Description:                                                              Submitted by:
                      Fri Jan 28 07:36:00 -0700 2005: #  Patch to remove the pre_args_ptr completely. (text/plain)                 uddeborg
                      Fri Jan 28 07:38:00 -0700 2005: #2 Patch to use *pre_args_ptr++ as the technique to assign args (text/plain) uddeborg

     Issue 1443 blocks:
   Votes for issue 1443:


   Opened: Fri Jan 28 07:35:00 -0700 2005 
------------------------


While investigating a problem with submitting
commands (issue 1442) I was confused bu tye use of
a pointer pre_args_ptr in the function
start_command in
source/daemons/shepherd/builtin_starter.c.  It is
set to point to the first element of pre_args, but
is then used as an array.  This original array
pre_args could be used instead.  I get the
impression that somebody intended to assign
successive values with the "*ptr++" idiom, but
then changed his mind and used ordinary array
indexing instead, without removing the pointer
variable from the code.

It was a bit confusing when reading the code, so I
would suggest cleaning it up.  It could be changed
in one of two ways.  Either the pre_args_ptr could
be removed, and all indexing could be done from
the original array.  Or the *ptr++ technique could
be used.  I'll attach two possible patches, one
for each case.

   ------- Additional comments from uddeborg Fri Jan 28 07:36:44 -0700 2005 -------
Created an attachment (id=36)
Patch to remove the pre_args_ptr completely.

   ------- Additional comments from uddeborg Fri Jan 28 07:38:31 -0700 2005 -------
Created an attachment (id=37)
Patch to use *pre_args_ptr++ as the technique to assign args

   ------- Additional comments from uddeborg Fri Jan 28 07:40:33 -0700 2005 -------
Oh, please note that these patches also include the bug fix I suggest
in issue 1442.  Sorry for mixing the two things together.

   ------- Additional comments from sgrell Tue Dec 6 08:17:23 -0700 2005 -------
Changed the Subcomponent.

Stephan

   ------- Additional comments from pollinger Tue Mar 7 02:24:51 -0700 2006 -------
Changed "Issue type" to task

Attachments (2)

36 (5.3 KB) - added by dlove 9 years ago.
37 (5.2 KB) - added by dlove 9 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by dlove

Changed 9 years ago by dlove

comment:1 Changed 9 years ago by dlove

  • Keywords patch added; removed
  • Severity set to minor

comment:2 Changed 9 years ago by dlove

  • Type changed from task to patch

comment:3 Changed 4 years ago by Dave Love <d.love@…>

  • Owner set to Dave Love <d.love@…>
  • Resolution set to fixed
  • Status changed from new to closed

In 4825/sge:

Fix #224: code cleanup in builtin_starter.c (from uddeborg, adapted)

Note: See TracTickets for help on using tickets.