Project

General

Profile

Actions

Bug #574

closed

Minor issues in usr/src/cmd/format/startup.c

Added by Roland Mainz over 12 years ago. Updated about 11 years ago.

Status:
Resolved
Priority:
Low
Assignee:
-
Category:
cmd - userland programs
Start date:
2010-12-27
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
format, good-first-bug
Gerrit CR:
External Bug:

Description

This came up during today's meeting:
Looking at http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/format/startup.c#2985 ... the code looks a bit inefficient:
1. There are multiple calls of |strlen(DISK_PREFIX)| where |DISK_PREFIX| is a constant string literal
2. The whole |memset(..., 0, ...)| for the buffer used by |readlink()| is an overkill because |readlink()| returns the number of bytes written into the buffer.
Actions #1

Updated by Albert Lee over 11 years ago

  • Category set to cmd - userland programs
  • Difficulty set to Bite-size
  • Tags set to format, good-first-bug
Actions #2

Updated by Albert Lee about 11 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Fixed in:
changeset: 13654:05c013fc7a3f
tag: tip
user: Alek Pinchuk <>
date: Sat Mar 31 16:43:18 2012 -0700
files: usr/src/cmd/format/startup.c
description:
574 Minor issues in usr/src/cmd/format/startup.c
Reviewed by: Dan McDonald <>
Reviewed by: Garrett D'Amore <>
Reviewed by: Albert Lee <>
Approved by: Albert Lee <>

Actions

Also available in: Atom PDF